Fix pointer to next available stack slot

This commit is contained in:
James Roseborough
2007-06-27 14:30:18 +00:00
parent c8e1934916
commit 2fe87230d8

View File

@@ -19,8 +19,8 @@ public class CallFrame {
public final LValue[] stack; public final LValue[] stack;
public int base; public int base;
public int top; public int top;
private final Closure cl; public final Closure cl;
private final Proto p; public final Proto p;
private final LValue[] k; private final LValue[] k;
private final int nresults; private final int nresults;
private int pc = 0; private int pc = 0;
@@ -73,7 +73,6 @@ public class CallFrame {
// reload the current calling context // reload the current calling context
int[] code = p.code; int[] code = p.code;
state.avail = base + p.maxstacksize;
while (true) { while (true) {
if (DEBUG) if (DEBUG)
@@ -310,8 +309,10 @@ public class CallFrame {
// pop the call stack // pop the call stack
done = true; done = true;
if ( --state.cc >= 0 ) if ( --state.cc >= 0 ) {
state.calls[state.cc].top = top; CallFrame call = state.calls[state.cc];
call.top = top;
}
// force a reload of the calling context // force a reload of the calling context
return; return;