]> granicus.if.org Git - graphviz/commitdiff
Fix a bug where a function symbol is evaluated during a cast operation.
authorerg <devnull@localhost>
Thu, 29 Jan 2009 22:42:06 +0000 (22:42 +0000)
committererg <devnull@localhost>
Thu, 29 Jan 2009 22:42:06 +0000 (22:42 +0000)
lib/expr/exgram.h

index 7287f0dd31f761d034a64924102deead5d441b84..7dfb8aa48b166410dbff458abe47db47104f3566 100644 (file)
@@ -408,9 +408,8 @@ extern "C" {
                exerror("cannot convert %s to %s", extypename(p, x->type),
                        extypename(p, type));
            if (x->op != CONSTANT) {
+               Exid_t *sym = (xref ? xref->data.variable.symbol : NiL);
                if (EXTERNAL(t2t)) {
-                   Exid_t *sym =
-                       (xref ? xref->data.variable.symbol : NiL);
                    int a = (arg ? arg : 1);
                    if ((*p->disc->convertf) (p, x, type, sym, a,
                                              p->disc) < 0) {
@@ -431,8 +430,8 @@ extern "C" {
                                                                       type));
                        }
                    }
-                   if (sym && (sym->lex == FUNCTION)) xref = NiL;
                }
+               if (sym && (sym->lex == FUNCTION)) xref = NiL;
                x = exnewnode(p, t2t, 0, type, x, xref);
            } else
                switch (t2t) {