diff --git a/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java b/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java index 7e09ab256..4ffb6b11b 100644 --- a/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java +++ b/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java @@ -23,6 +23,7 @@ import org.teavm.javascript.spi.Generator; import org.teavm.javascript.spi.InjectedBy; import org.teavm.model.*; import org.teavm.model.instructions.InvokeInstruction; +import org.teavm.model.instructions.MonitorEnterInstruction; import org.teavm.model.util.AsyncProgramSplitter; import org.teavm.model.util.ProgramUtils; @@ -310,7 +311,7 @@ public class Decompiler { generator.setCurrentLocation(nodeLocation); } insn.acceptVisitor(generator); - if (insn instanceof InvokeInstruction && !saved) { + if (!saved && (insn instanceof InvokeInstruction || insn instanceof MonitorEnterInstruction)) { generator.statements.add(new SaveStatement()); saved = true; }