Fix calling convention by managing top of stack and adjusting on way in and out of function calls.

This commit is contained in:
James Roseborough
2007-06-11 05:51:19 +00:00
parent 05cfdaa33b
commit da6f63bb3d
5 changed files with 18 additions and 17 deletions

View File

@@ -50,14 +50,15 @@ public class LTable extends LValue {
}
// perform a lua call
public int luaStackCall(StackState state, int base, int nargs) {
public void luaStackCall(StackState state, int base) {
if ( e.hasMoreElements() ) {
LValue key = (LValue) e.nextElement();
state.adjustTop(base+2);
state.stack[base] = key;
state.stack[base+1] = t.luaGetTable(key);
return 2;
} else {
state.adjustTop(base);
}
return 0;
}
}

View File

@@ -15,9 +15,8 @@ public class LValue {
}
// perform a lua call, return number of results actually produced
public int luaStackCall(StackState state, int base, int nargs) {
public void luaStackCall(StackState state, int base) {
luaUnsupportedOperation();
return 0;
}
// unsupported except for numbers