fix: wrong index calculation

This commit is contained in:
2024-12-10 01:09:50 +02:00
parent 814e0d7b7e
commit 8d7939d85a

View File

@@ -39,7 +39,7 @@ public final class VariableIndex {
} }
public final Instruction toSet(boolean keep) { public final Instruction toSet(boolean keep) {
switch (type) { switch (type) {
case CAPTURES: return Instruction.storeVar(index, keep, false); case CAPTURES: return Instruction.storeVar(~index, keep, false);
case CAPTURABLES: return Instruction.storeVar(index, keep, false); case CAPTURABLES: return Instruction.storeVar(index, keep, false);
case LOCALS: return Instruction.storeVar(index, keep, false); case LOCALS: return Instruction.storeVar(index, keep, false);
default: throw new UnsupportedOperationException("Unknown index type " + type); default: throw new UnsupportedOperationException("Unknown index type " + type);