From 29339f3fbcc808a55d08e751cb9f5b44aca5ffd6 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Thu, 19 Sep 2024 20:26:32 +0200 Subject: [PATCH] Fix old Wasm backend --- .../generate/common/methods/BaseWasmGenerationVisitor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/teavm/backend/wasm/generate/common/methods/BaseWasmGenerationVisitor.java b/core/src/main/java/org/teavm/backend/wasm/generate/common/methods/BaseWasmGenerationVisitor.java index fccdd8022..592beadb6 100644 --- a/core/src/main/java/org/teavm/backend/wasm/generate/common/methods/BaseWasmGenerationVisitor.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/common/methods/BaseWasmGenerationVisitor.java @@ -1333,7 +1333,9 @@ public abstract class BaseWasmGenerationVisitor implements StatementVisitor, Exp WasmBlock targetBlock) { var exceptionType = ValueType.object(tryCatch.getExceptionType()); var isMatched = generateInstanceOf(new WasmGetLocal(exceptionVar), exceptionType); - target.add(new WasmBranch(isMatched, targetBlock)); + var br = new WasmBranch(isMatched, targetBlock); + br.setResult(new WasmGetLocal(exceptionVar)); + target.add(new WasmDrop(br)); } private void visitMany(List statements, List target) {