Skip to content

Commit ad57378

Browse files
committed
compiler: fix continue-in-switch-in-switch-in-while
previously it threw a "Reentered block with different amount of vars on stack" error when re-decompiling the script this makes txr compile properly i think i think this is a compiler error because it decompiles when i make that same script in gamemaker
1 parent 78a99df commit ad57378

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

UndertaleModLib/Compiler/AssemblyWriter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,9 @@ private static void AssembleStatement(CodeWriter cw, Parser.Statement s, int rem
904904
endPatch.Add(cw.Emit(Opcode.B));
905905

906906
continueEndPatch.Finish(cw);
907-
cw.Emit(Opcode.Popz, compareType);
907+
for (int i = 0; i < cw.otherContexts.Count + 1; i++) {
908+
cw.Emit(Opcode.Popz, compareType);
909+
}
908910
enclosingContext.UseContinue().Add(cw.Emit(Opcode.B));
909911
}
910912

0 commit comments

Comments
 (0)