Skip to content

Commit 10a9447

Browse files
committed
issue #58 : invNeedsTmpVar(Invocation inv) returned false positives
1 parent b736b86 commit 10a9447

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/transform/InstrumentCode.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import eu.mihosoft.vrl.lang.model.Invocation;
1818
import eu.mihosoft.vrl.lang.model.MethodDeclaration;
1919
import eu.mihosoft.vrl.lang.model.Operator;
20+
import eu.mihosoft.vrl.lang.model.ReturnStatementInvocation;
2021
import eu.mihosoft.vrl.lang.model.Scope;
2122
import eu.mihosoft.vrl.lang.model.ScopeInvocation;
2223
import eu.mihosoft.vrl.lang.model.Type;
@@ -164,9 +165,13 @@ private boolean invNeedsTmpVar(Invocation inv) {
164165
if (inv instanceof DeclarationInvocation) {
165166
return false;
166167
}
168+
169+
if (inv instanceof ReturnStatementInvocation) {
170+
return false;
171+
}
167172

168173
if (!(inv instanceof BinaryOperatorInvocationImpl)) {
169-
return false;
174+
return true;
170175
}
171176

172177
BinaryOperatorInvocationImpl boi = (BinaryOperatorInvocationImpl) inv;

0 commit comments

Comments
 (0)