diff mc-codegen.c @ 533:80b5058f0535 inline-code-gen-passed

inline code-gen test passed.
author kono
date Fri, 30 Dec 2005 18:33:55 +0900
parents 6b0fd56848e6
children 0f24e1dba811
line wrap: on
line diff
--- a/mc-codegen.c	Fri Dec 30 13:36:17 2005 +0900
+++ b/mc-codegen.c	Fri Dec 30 18:33:55 2005 +0900
@@ -3252,7 +3252,7 @@
 /* right value , get the value of the variable */
 
 static int
-indirect(int t,int e1)
+indirect(int t,int e1,int type)
 {
     int e2,e3,e4,offset;
     e2 = e1;
@@ -3271,7 +3271,7 @@
 extern int
 rvalue(int e)
 {
-    int op,c,e1;
+    int op,c;
     NMTBL *n;    
     int type0 = type_value(type);
 
@@ -3332,10 +3332,9 @@
 	}
 	return(list3(RLVAR+op,cadr(e),caddr(e)));
     case INDIRECT:
-	e1=cadr(e);
-	return(indirect(RINDIRECT+op,cadr(e)));
+	return(indirect(RINDIRECT+op,cadr(e),type0));
     case IVAR:
-	return(indirect(RINDIRECT+op,e));
+	return(indirect(RINDIRECT+op,e,type0));
     default:return(e); /* idempotent case? */
     }
 }
@@ -3815,7 +3814,8 @@
 	    return(e1);
 	if (car(e)==CONST) {
 	    if(car(e1)==ADDRESS) {
-		if (car(cadr(e1))!=GVAR) {
+		if (car(cadr(e1))==IVAR) {
+		} else if (car(cadr(e1))!=GVAR) {
 		    // must be lvar
 		    if (car(cadr(e1))!=LVAR) error(-1);
 		    return(list2(ADDRESS,