Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.37
 
1.38
 
MAIN:ragge:20110407185015
 
optim.c
_>8383 NODE *
 8484 optim(NODE *p)
 8585 {
<>86 -        struct attr *ap;
8786         int o, ty;
 8887         NODE *sp, *q;
<>89 -        int i;
  88+        int i, sz;
9089         TWORD t;
 9190 
 9291         t = BTYPE(p->n_type);
     
 !
143142                 if (LCON(p) && RCON(p) && conval(p->n_left, o, p->n_right))
 144143                         goto zapright;
 145144 
<>146 -                ap = attr_find(p->n_ap, ATTR_BASETYP);
  145+                sz = tsize(p->n_type, p->n_df, p->n_ap);
147146 
 148147                 if (LO(p) == RS && RCON(p->n_left) && RCON(p) &&
<>149 -                    (RV(p) + RV(p->n_left)) < ap->atypsz) {
  148+                    (RV(p) + RV(p->n_left)) < sz) {
150149                         /* two right-shift  by constants */
 151150                         RV(p) += RV(p->n_left);
 152151                         p->n_left = zapleft(p->n_left);
     
 !
175174                         } else
 176175 #endif
 177176                         /* avoid larger shifts than type size */
<>178 -                        if (RV(p) >= ap->atypsz) {
 179 -                                RV(p) = RV(p) %
 180 -                                    attr_find(p->n_ap, ATTR_BASETYP)->atypsz;
  177+                        if (RV(p) >= sz) {
  178+                                RV(p) = RV(p) % sz;
181179                                 werror("shift larger than type");
 182180                         }
 183181                         if (RV(p) == 0)
     
 !
189187                 if (LCON(p) && RCON(p) && conval(p->n_left, o, p->n_right))
 190188                         goto zapright;
 191189 
<>192 -                ap = attr_find(p->n_ap, ATTR_BASETYP);
  190+                sz = tsize(p->n_type, p->n_df, p->n_ap);
193191 
 194192                 if (LO(p) == LS && RCON(p->n_left) && RCON(p)) {
 195193                         /* two left-shift  by constants */
     
 !
217215                         } else
 218216 #endif
 219217                         /* avoid larger shifts than type size */
<>220 -                        if (RV(p) >= ap->atypsz) {
 221 -                                RV(p) = RV(p) %
 222 -                                    attr_find(p->n_ap, ATTR_BASETYP)->atypsz;
  218+                        if (RV(p) >= sz) {
  219+                                RV(p) = RV(p) % sz;
223220                                 werror("shift larger than type");
 224221                         }
 225222                         if (RV(p) == 0
     
 !
316313                         RV(p) = i;
 317314                         q = p->n_right;
 318315                         if(tsize(q->n_type, q->n_df, q->n_ap) > SZINT)
<>319 -                                p->n_right = makety(q, INT, 0, 0, MKAP(INT));
  316+                                p->n_right = makety(q, INT, 0, 0, 0);
<_320317 
 321318                         break;
 322319                 }
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-07-10 21:30 +0200