Lua 5.2 compatibility fixes.

This commit is contained in:
James Roseborough
2012-09-05 04:24:44 +00:00
parent c4791e2e3e
commit ed4554fa7d
6 changed files with 27 additions and 45 deletions

View File

@@ -234,19 +234,10 @@ public class JavaBuilder {
storeLocal(-1, slot);
}
}
boolean needsarg = ((p.is_vararg & Lua.VARARG_NEEDSARG) != 0);
if ( needsarg ) {
append(new ALOAD(1));
append(new PUSH(cp, 1 + p.numparams));
append(factory.createInvoke(STR_LUAVALUE, "tableOf", TYPE_LUATABLE, ARG_TYPES_VARARGS_INT, Constants.INVOKESTATIC));
storeLocal(-1, slot++ );
}
else if ( p.numparams > 0 ) {
append(new ALOAD(1));
append(new PUSH(cp, 1 + p.numparams));
append(factory.createInvoke(STR_VARARGS, "subargs", TYPE_VARARGS, ARG_TYPES_INT, Constants.INVOKEVIRTUAL));
append(new ASTORE(1));
}
append(new ALOAD(1));
append(new PUSH(cp, 1 + p.numparams));
append(factory.createInvoke(STR_VARARGS, "subargs", TYPE_VARARGS, ARG_TYPES_INT, Constants.INVOKEVIRTUAL));
append(new ASTORE(1));
} else {
// fixed arg function between 0 and 3 arguments
for ( slot=0; slot<p.numparams; slot++ ) {