From 10a94477eba83c6f52b6c9b53a7b10336b891525 Mon Sep 17 00:00:00 2001 From: Michael Hoffer Date: Fri, 7 Aug 2015 12:58:06 +0200 Subject: [PATCH] issue #58 : invNeedsTmpVar(Invocation inv) returned false positives --- .../mihosoft/vrl/lang/model/transform/InstrumentCode.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/transform/InstrumentCode.java b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/transform/InstrumentCode.java index f0a53518..c2cb9d39 100644 --- a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/transform/InstrumentCode.java +++ b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/transform/InstrumentCode.java @@ -17,6 +17,7 @@ import eu.mihosoft.vrl.lang.model.Invocation; import eu.mihosoft.vrl.lang.model.MethodDeclaration; import eu.mihosoft.vrl.lang.model.Operator; +import eu.mihosoft.vrl.lang.model.ReturnStatementInvocation; import eu.mihosoft.vrl.lang.model.Scope; import eu.mihosoft.vrl.lang.model.ScopeInvocation; import eu.mihosoft.vrl.lang.model.Type; @@ -164,9 +165,13 @@ private boolean invNeedsTmpVar(Invocation inv) { if (inv instanceof DeclarationInvocation) { return false; } + + if (inv instanceof ReturnStatementInvocation) { + return false; + } if (!(inv instanceof BinaryOperatorInvocationImpl)) { - return false; + return true; } BinaryOperatorInvocationImpl boi = (BinaryOperatorInvocationImpl) inv;