Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.267
 
1.268
 
MAIN:ragge:20090819184332
 
pftn.c
_>20742074 }
 20752075 
 20762076 /*
<> 2077+ * See if there is a goto in the tree.
  2078+ * XXX this function is a hack for a flaw in handling of
  2079+ * compound expressions and inline functions and should not be
  2080+ * needed.
  2081+ */
  2082+static int
  2083+hasgoto(NODE *p)
  2084+{
  2085+        int o = coptype(p->n_op);
  2086+
  2087+        if (o == LTYPE)
  2088+                return 0;
  2089+        if (p->n_op == GOTO)
  2090+                return 1;
  2091+        if (o == UTYPE)
  2092+                return hasgoto(p->n_left);
  2093+        if (hasgoto(p->n_left))
  2094+                return 1;
  2095+        return hasgoto(p->n_right);
  2096+}
  2097+
  2098+/*
20772099  * Determine if a value is known to be constant at compile-time and
 20782100  * hence that PCC can perform constant-folding on expressions involving
 20792101  * that value.
     
 !
20842106         int isconst = (a != NULL && a->n_op == ICON);
 20852107 
 20862108         tfree(f);
<>2087 -        if (a && a->n_op == COMOP && a->n_left->n_op == GOTO) {
 2088 -                tfree(a->n_right);
 2089 -                a->n_right = bcon(0);
  2109+        if (a && hasgoto(a)) {
  2110+                a = buildtree(COMOP, a, bcon(0));
<_20902111         } else {
 20912112                 tfree(a);
 20922113                 a = bcon(isconst);
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-10-30 14:00 +0100