diff --git a/ExprPrimaryNodes.py b/ExprPrimaryNodes.py index f175856745c84cc2616f6991e21b2a945905a7e4..0fbcee7168fd6eca61042be4f02b0959f29338f7 100644 --- a/ExprPrimaryNodes.py +++ b/ExprPrimaryNodes.py @@ -831,7 +831,7 @@ class MethodInvNode(ASTNode): if self.args: toPop = len(self.args.exprs) - self.code += p(instruction="add", arg1="esp", arg2=toPop, comment="popping off all arguments off stack") + self.code += p(instruction="add", arg1="esp", arg2=toPop*4, comment="popping off all arguments off stack") # Epilogue self.code += epi diff --git a/Tests/A5/J1_01_basicTest.java b/Tests/A5/J1_01_basicTest.java index dd5b796567130e138dfea50ded9552ea150e5a63..b2b700cf49e38d3f58e24f210adceace38e1a220 100644 --- a/Tests/A5/J1_01_basicTest.java +++ b/Tests/A5/J1_01_basicTest.java @@ -3,12 +3,12 @@ public class J1_01_basicTest { public J1_01_basicTest() {} public static int test() { - return J1_01_basicTest.test2(); + return J1_01_basicTest.test2(4,5); } - public static int test2(){ + public static int test2(int i, int j){ if (true) - return 123; - return 7; + return i; + return j; } }