From 92403f9ec0819dd2f7d43bb60bd6bb3c5749ed63 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Mon, 7 Oct 2019 18:45:43 +0300 Subject: [PATCH] Fix bug in metaprogramming API --- .../teavm/metaprogramming/impl/CompositeMethodGenerator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metaprogramming/impl/src/main/java/org/teavm/metaprogramming/impl/CompositeMethodGenerator.java b/metaprogramming/impl/src/main/java/org/teavm/metaprogramming/impl/CompositeMethodGenerator.java index 3734704f6..007481039 100644 --- a/metaprogramming/impl/src/main/java/org/teavm/metaprogramming/impl/CompositeMethodGenerator.java +++ b/metaprogramming/impl/src/main/java/org/teavm/metaprogramming/impl/CompositeMethodGenerator.java @@ -681,6 +681,7 @@ public class CompositeMethodGenerator { BasicBlock target = program.basicBlockAt(returnBlockIndex); if (valueToReturn != null) { + Variable valueToReturnResolved = var(valueToReturn); if (resultVar == null) { resultVar = program.createVariable(); resultPhi = new Phi(); @@ -689,7 +690,7 @@ public class CompositeMethodGenerator { } Incoming incoming = new Incoming(); incoming.setSource(program.basicBlockAt(blockIndex)); - incoming.setValue(var(valueToReturn)); + incoming.setValue(valueToReturnResolved); resultPhi.getIncomings().add(incoming); }