add "this" for first arg
authorbrian <brian@brianweb.net>
Sun, 3 Jul 2005 21:21:40 +0000 (21:21 +0000)
committerbrian <brian@brianweb.net>
Sun, 3 Jul 2005 21:21:40 +0000 (21:21 +0000)
darcs-hash:20050703212140-24bed-e07443bc57a4a4fc20eff8fbe4eb739f9a4efe6a.gz

src/org/ibex/classgen/JSSA.java

index 090fc97..e608b42 100644 (file)
@@ -15,8 +15,11 @@ public class JSSA extends MethodGen implements CGConst {
         super(c, in, cp);
         local = new Expr[maxLocals];
         stack = new Expr[maxStack];
         super(c, in, cp);
         local = new Expr[maxLocals];
         stack = new Expr[maxStack];
-        for(int i=0; i<this.method.getNumArgs(); i++)
-            local[i] = new Argument("arg"+i, this.method.getArgType(i));
+        int n=0;
+        if (!isStatic())
+            local[n++] = new Argument("this",method.getDeclaringClass());
+        for(int i=0;i<this.method.getNumArgs(); i++)
+            local[n++] = new Argument("arg"+i, this.method.getArgType(i));
         for(int i=0; i<size(); i++) {
             int    op  = get(i);
             Object arg = getArg(i);
         for(int i=0; i<size(); i++) {
             int    op  = get(i);
             Object arg = getArg(i);