Skip over empty branch destinations
This commit is contained in:
@@ -696,9 +696,12 @@ public class JavaBuilder {
|
|||||||
int nc = p.code.length;
|
int nc = p.code.length;
|
||||||
for (int pc = 0; pc < nc; pc++) {
|
for (int pc = 0; pc < nc; pc++) {
|
||||||
if (branches[pc] != null) {
|
if (branches[pc] != null) {
|
||||||
if ( branchDestHandles[targets[pc]] == null )
|
int t=targets[pc];
|
||||||
throw new IllegalArgumentException("no target at "+targets[pc]+" op="+Lua.GET_OPCODE(p.code[targets[pc]]));
|
while ( t<branchDestHandles.length && branchDestHandles[t] == null )
|
||||||
branches[pc].setTarget(branchDestHandles[targets[pc]]);
|
t++;
|
||||||
|
if ( t>= branchDestHandles.length )
|
||||||
|
throw new IllegalArgumentException("no target at or after "+targets[pc]+" op="+Lua.GET_OPCODE(p.code[targets[pc]]));
|
||||||
|
branches[pc].setTarget(branchDestHandles[t]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user