# HG changeset patch # User Shinji KONO # Date 1291335509 -32400 # Node ID ff5dfee8082983d2906de12e9ba2250787498da2 # Parent d5dfc30826bab57acb14e9dc2e6f99f90040ad42 INDIRECT handling in pexpr diff -r d5dfc30826ba -r ff5dfee80829 mc-codegen.c --- a/mc-codegen.c Thu Dec 02 10:04:35 2010 +0900 +++ b/mc-codegen.c Fri Dec 03 09:18:29 2010 +0900 @@ -1796,7 +1796,7 @@ return(list2(ADDRESS, list3n(LVAR,cadr(cadr(e1))+cadr(e), ncaddr(cadr(e1))))); - case INDIRECT: + // case INDIRECT: case PERIOD: case ARROW: if (lp64) return list3(LADD,e1,llist2(LCONST,cadr(e))); @@ -3166,7 +3166,7 @@ mode = smode; return e; } - switch (car(e)%SOP){ + switch (OP(car(e))){ // special cases case ARROW: case PERIOD: @@ -3174,7 +3174,7 @@ case LVAR: case RLVAR:case URLVAR: case GVAR: case RGVAR:case URGVAR: return (e>gfree)?glist3(car(e),cadr(e),caddr(e)):e; - case INDIRECT: case RINDIRECT: + case INDIRECT: // case RINDIRECT: return glist2(car(e),copy_expr(cadr(e))); } if (LIST_ARGS(car(e))){ diff -r d5dfc30826ba -r ff5dfee80829 mc-inline.c --- a/mc-inline.c Thu Dec 02 10:04:35 2010 +0900 +++ b/mc-inline.c Fri Dec 03 09:18:29 2010 +0900 @@ -527,9 +527,9 @@ if (type0>0 && car(type0)==POINTER) type=set_type_with_attr(cadr(type),type); if (car(lvar=cadr(e))==IVAR) { - lvar=p_lvar(cadr(e)); // can be anything.... - switch(car(lvar)) { - case LVAR: + lvar=p_lvar(cadr(e)); // can be anything.... + switch(car(lvar)) { + case LVAR: type = cadddr(e); return rvalue(lvar); case REGISTER: case DREGISTER: @@ -538,9 +538,12 @@ // should do type check if (offset) error(-1); return lvar; + default: + error(-1); } } - return list3(car(e),pexpr(cadr(e)),offset); + int e2 = pexpr(cadr(e)); + return list3(car(e),e2,offset); #endif } @@ -550,7 +553,11 @@ //int lvar; //if (car(lvar=cadr(e))==IVAR) // lvar=p_lvar(cadr(e)); // can be anything.... +#if 0 + return pexpr(cadr(e)); +#else return list3(car(e),pexpr(cadr(e)),caddr(e)); +#endif } static int