From 82a6f471669651747d290bb2251159e1ba3214b3 Mon Sep 17 00:00:00 2001 From: Terence Parr Date: Fri, 7 Apr 2017 12:45:52 -0700 Subject: [PATCH] args were put in wrong order into locals --- simple-virtual-machine.ipr | 2 +- src/vm/VM.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/simple-virtual-machine.ipr b/simple-virtual-machine.ipr index 393f27d..fb30613 100644 --- a/simple-virtual-machine.ipr +++ b/simple-virtual-machine.ipr @@ -154,7 +154,7 @@ - + diff --git a/src/vm/VM.java b/src/vm/VM.java index 87df7c9..bd5a6a2 100644 --- a/src/vm/VM.java +++ b/src/vm/VM.java @@ -139,8 +139,9 @@ protected void cpu() { int nargs = metadata[findex].nargs; // how many args got pushed ctx = new Context(ctx,ip,metadata[findex]); // copy args into new context + int firstarg = sp-nargs+1; for (int i=0; i