fix varargs processing when followed by function call (test9.lua)

This commit is contained in:
James Roseborough
2009-04-27 22:43:45 +00:00
parent d6cbf423a3
commit 6a1fdfb6b0

View File

@@ -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;
} }
} }