From 8184c46bae80e7b7f556869f43270a0d532af739 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Mon, 9 Sep 2024 19:06:52 +0200 Subject: [PATCH] Revert change is ResourceProgramTransformer which is not necessary for WasmGC BE, but breaks C BE --- .../teavm/platform/plugin/ResourceProgramTransformer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/src/main/java/org/teavm/platform/plugin/ResourceProgramTransformer.java b/platform/src/main/java/org/teavm/platform/plugin/ResourceProgramTransformer.java index 51df6b8ef..be7101645 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/ResourceProgramTransformer.java +++ b/platform/src/main/java/org/teavm/platform/plugin/ResourceProgramTransformer.java @@ -78,7 +78,11 @@ class ResourceProgramTransformer { private void removeCastToResource(CastInstruction cast) { if (!cast.isWeak() && hierarchy.isSuperType(RESOURCE, cast.getTargetType(), false)) { - cast.setWeak(true); + AssignInstruction assign = new AssignInstruction(); + assign.setReceiver(cast.getReceiver()); + assign.setAssignee(cast.getValue()); + assign.setLocation(cast.getLocation()); + cast.replace(assign); } }