Skip to content

Commit

Permalink
fix: Regression in lookupswitch with wrong indentation after default …
Browse files Browse the repository at this point in the history
…case
  • Loading branch information
Col-E committed Jan 27, 2024
1 parent 0c38984 commit d46f3af
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,14 @@ public void execute(VarInstruction instruction) {
@Override
public void execute(LookupSwitchInstruction instruction) {
var obj = ctx.instruction("lookupswitch").object();
obj.value("default").print(labelNames.get(instruction.defaultTarget().getIndex())).next();
// Java has no zip function
int[] keys = instruction.keys();
List<Label> targets = instruction.targets();
if (keys.length != 0) {
printLookupCase(obj, keys[0], targets.get(0));
for (int i = 1; i < keys.length; i++) {
obj.next();
printLookupCase(obj, keys[i], targets.get(i));
}
for (int i = 0; i < keys.length; i++) {
printLookupCase(obj, keys[i], targets.get(i));
obj.next();
}
obj.value("default").print(labelNames.get(instruction.defaultTarget().getIndex()));
obj.end();
ctx.next();
}
Expand Down

0 comments on commit d46f3af

Please sign in to comment.