Improve bytecode generation.

This commit is contained in:
James Roseborough
2010-08-05 21:41:19 +00:00
parent 80c111c50d
commit a1e0bc520d
2 changed files with 6 additions and 6 deletions

View File

@@ -170,7 +170,7 @@ public class Slots {
break; break;
case Lua.OP_JMP: /* sBx pc+=sBx */ case Lua.OP_JMP: /* sBx pc+=sBx */
if ( sbx < 0 ) //if ( sbx < 0 )
branchdest[index+1+sbx] = true; branchdest[index+1+sbx] = true;
ins = p.code[index+0+sbx]; ins = p.code[index+0+sbx];
if ( Lua.GET_OPCODE(ins) == Lua.OP_TFORLOOP ) { if ( Lua.GET_OPCODE(ins) == Lua.OP_TFORLOOP ) {

View File

@@ -37,12 +37,12 @@ public class TestLuaJC {
// create the script // create the script
public static String name = "script"; public static String name = "script";
public static String script = public static String script =
"local a = unpack()\n"+ "local t = a or nil\n"+
"local b = c and { d = e }\n"+ "local t\n" +
"local f\n"+ "b = function()\n"+
"local function g()\n"+ " return t\n"+
" return f\n"+
"end\n"+ "end\n"+
"return t\n"+
""; "";
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {