Improve calling convention handling when the number of arguments doesn't match the expected number, and the number of return values doesn't match those needed.
This commit is contained in:
@@ -50,15 +50,14 @@ public class LTable extends LValue {
|
||||
}
|
||||
|
||||
// perform a lua call
|
||||
public void luaStackCall(StackState state, int base, int nresults) {
|
||||
public int luaStackCall(StackState state, int base, int nargs) {
|
||||
if ( e.hasMoreElements() ) {
|
||||
LValue key = (LValue) e.nextElement();
|
||||
state.stack[base] = key;
|
||||
state.stack[base+1] = t.luaGetTable(key);
|
||||
} else {
|
||||
state.stack[base] = LNil.NIL;
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,10 @@ public class LValue {
|
||||
return true;
|
||||
}
|
||||
|
||||
// perform a lua call
|
||||
public void luaStackCall(StackState state, int base, int nargs) {
|
||||
// perform a lua call, return number of results actually produced
|
||||
public int luaStackCall(StackState state, int base, int nargs) {
|
||||
luaUnsupportedOperation();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// unsupported except for numbers
|
||||
|
||||
Reference in New Issue
Block a user