# HG changeset patch # User Shinji KONO # Date 1291350559 -32400 # Node ID bc919d849346582ef5a3aecc3ed9213da322332c # Parent a22aabb27786b5ee679d2a84aa384425d24c9bee arrow in parse mode diff -r a22aabb27786 -r bc919d849346 mc-code-i64.c --- a/mc-code-i64.c Fri Dec 03 11:32:50 2010 +0900 +++ b/mc-code-i64.c Fri Dec 03 13:29:19 2010 +0900 @@ -2774,8 +2774,10 @@ case ADD: printf("\tadd%s $%ld,%s\n",q,orn,crn); break; - case SUB: case CMP: + case SUB: printf("\tsub%s $%ld,%s\n",q,orn,crn); + case CMP: + printf("\tcmp%s $%ld,%s\n",q,orn,crn); break; case BAND: if (datareg&&(orn & ~255)==~255) diff -r a22aabb27786 -r bc919d849346 mc-inline.c --- a/mc-inline.c Fri Dec 03 11:32:50 2010 +0900 +++ b/mc-inline.c Fri Dec 03 13:29:19 2010 +0900 @@ -1311,6 +1311,8 @@ type = caddr(e1); return strop(e2,0); case ARROW: + type = caddr(e1); + e2 = rvalue(e2); e2 = pexpr(e2); nptr = ncadddr(e1); type = caddr(e1); diff -r a22aabb27786 -r bc919d849346 test/tmp11.c --- a/test/tmp11.c Fri Dec 03 11:32:50 2010 +0900 +++ b/test/tmp11.c Fri Dec 03 13:29:19 2010 +0900 @@ -4,6 +4,7 @@ char *nm; int sc,ty,dsp; } NMTBL; NMTBL *a; +NMTBL f; NMTBL * test2(char *n) { @@ -24,13 +25,31 @@ return test0(a,b,c); } +int heap[10]; + +#define ncaddr(e) (*(NMTBL**)&heap[e+2]) + int main() { int d; NMTBL *b; + f.nm = "_name"; + a = &f; b = test2("test"); d = test1(1,2,3); printf("#0033:return %d\n",d); + + NMTBL **p = (NMTBL**)&heap[2]; + *p = &f; + b = &f; + int e = 0; + printf("f.nm %s\n",f.nm); + printf("b->nm %s\n",b->nm); + printf("(*p)->nm %s\n",(*p)->nm); + printf("ncaddr(e)->nm %s\n",ncaddr(e)->nm); + return d; } + +/* end */