Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.119
 
1.120
 
MAIN:ragge:20040905114414
 
pftn.c
_>12041204                 }
 12051205 
 12061206                 if (iclass==AUTO || iclass == REGISTER) {
<>1207 -                        if (t == STRTY || t == UNIONTY)
  1207+                        if (t == STRTY || t == UNIONTY || ISARY(t))
12081208                                 return; /* dealt with in doinit() */
<> 1209+#if 0
12091210                         if (ISARY(t))
 12101211                                 uerror("no automatic aggregate initialization");
<> 1212+#endif
12111213                 }
 12121214 
 12131215                 /* now, if this is not a scalar, put on another element */
     
 !
14471449                 }
 14481450 
 14491451         if( iclass == AUTO || iclass == REGISTER ){
<>1450 -                /* do the initialization and get out, without regard
 1451 -                    for filing out the variable with zeros, etc. */
 1452 -                bccode();
 1453 -                send_passt(IP_NEWBLK, regvar, autooff);
  1452+                /*
  1453+                 * do the initialization and get out, without regard
  1454+                 * for filing out the variable with zeros, etc.
  1455+                 * Also deal with structs/arrays on stack.
  1456+                 * pstk has info about the variable, p about what
  1457+                 * should be initiated with.
  1458+                 */
  1459+                bccode(); /* XXX ??? */
  1460+                send_passt(IP_NEWBLK, regvar, autooff); /* Wrong place */
  1461+
14541462                 spname = pstk->in_sym;
<>1455 -                u = buildtree(NAME, NIL, NIL);
 1456 -#ifdef notdef
 1457 -                /* Should allow for array init */
 1458 -                if (ISARY(u->n_type))
 1459 -                        u = buildtree(ADDROF, u, NIL);
 1460 -#endif
 1461 -                p = buildtree( ASSIGN, u, p );
  1463+                u = buildtree(NAME, NIL, NIL); /* Get variable node */
  1464+//fwalk(p, eprint, 0);
  1465+//fwalk(u, eprint, 0);
  1466+                /* Allow for array init */
  1467+                if (ISARY(u->n_type)) {
  1468+                        if (u->n_type != p->n_type || p->n_type != ARY+CHAR)
  1469+                                uerror("illegal types in assignment");
  1470+                        /*
  1471+                         * Check and construct the assign tree here.
  1472+                         * Don't wanna go through buildtree(), too messy.
  1473+                         */
  1474+                        if (pstk->in_sym->sdf->ddim == 0) {
  1475+                                /* Get size from string */
  1476+                                pstk->in_sym->sdf->ddim = p->n_df->ddim;
  1477+//printf("size set to %d\n", p->n_df->ddim);
  1478+                                /* Adjust stack accordingly */
  1479+                                pstk->in_sym->soffset = NOOFFSET;
  1480+                                oalloc(pstk->in_sym, &autooff);
  1481+                                if (autooff > maxautooff)
  1482+                                        maxautooff = autooff;
  1483+                        }
  1484+                        p = buildtree(ADDROF, p, NIL);
  1485+                        p = block(STASG, u, p, u->n_type, u->n_df, u->n_sue);
  1486+                        p = block(UMUL, p, NIL, u->n_type, u->n_df, u->n_sue);
  1487+//fwalk(p, eprint, 0);
  1488+//                      if (p->n_op != STRING)
  1489+//                              uerror("bad init op %d", p->n_op);
  1490+
  1491+
  1492+                } else
  1493+                        p = buildtree( ASSIGN, u, p );
  1494+printf("after assign:\n");
  1495+fwalk(p, eprint, 0);
<_14621496                 ecomp(p);
 14631497                 return;
 14641498                 }
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-08-23 20:12 +0200