fix varargs processing when followed by function call (test9.lua)
This commit is contained in:
@@ -555,6 +555,7 @@ public class LuaState extends Lua {
|
|||||||
// allow debug hooks a chance to operate
|
// allow debug hooks a chance to operate
|
||||||
debugHooks( ci.pc );
|
debugHooks( ci.pc );
|
||||||
if ( hooksenabled ) {
|
if ( hooksenabled ) {
|
||||||
|
//Print.printState(this, base, top, base+cl.p.maxstacksize, cl, ci.pc);
|
||||||
debugBytecodeHooks( ci.pc );
|
debugBytecodeHooks( ci.pc );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -941,15 +942,15 @@ public class LuaState extends Lua {
|
|||||||
n = nvarargs.toJavaInt();
|
n = nvarargs.toJavaInt();
|
||||||
if (b == LuaState.LUA_MULTRET) {
|
if (b == LuaState.LUA_MULTRET) {
|
||||||
b = n; // use entire varargs supplied
|
b = n; // use entire varargs supplied
|
||||||
|
luaV_settop_fillabove( base + a + b );
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy args up to call stack area
|
// copy args up to call stack area
|
||||||
checkstack(a+b);
|
checkstack(a+b);
|
||||||
for (int j = 0; j < b; j++)
|
for (int j = 0; j < b; j++)
|
||||||
this.stack[base + a + j] = (j < n ? this.stack[base
|
this.stack[base + a + j] = (j < n ?
|
||||||
- n + j - 1]
|
this.stack[base - n + j - 1]
|
||||||
: LNil.NIL);
|
: LNil.NIL);
|
||||||
luaV_settop_fillabove( base + a + b );
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user