fix: wrong index calculation

This commit is contained in:
TopchetoEU 2024-12-10 01:09:50 +02:00
parent 814e0d7b7e
commit 8d7939d85a
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -39,7 +39,7 @@ public final class VariableIndex {
}
public final Instruction toSet(boolean keep) {
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 LOCALS: return Instruction.storeVar(index, keep, false);
default: throw new UnsupportedOperationException("Unknown index type " + type);