Skip to content

Commit

Permalink
issue #58 : invNeedsTmpVar(Invocation inv) returned false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
miho committed Aug 7, 2015
1 parent b736b86 commit fe5e6e7
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

import eu.mihosoft.vrl.lang.model.Argument;
import eu.mihosoft.vrl.lang.model.BinaryOperatorInvocationImpl;
import eu.mihosoft.vrl.lang.model.BreakInvocation;
import eu.mihosoft.vrl.lang.model.ClassDeclaration;
import eu.mihosoft.vrl.lang.model.CompilationUnitDeclaration;
import eu.mihosoft.vrl.lang.model.ContinueInvocation;
import eu.mihosoft.vrl.lang.model.ControlFlow;
import eu.mihosoft.vrl.lang.model.ControlFlowScope;
import eu.mihosoft.vrl.lang.model.DeclarationInvocation;
Expand All @@ -17,6 +19,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;
Expand Down Expand Up @@ -164,9 +167,21 @@ private boolean invNeedsTmpVar(Invocation inv) {
if (inv instanceof DeclarationInvocation) {
return false;
}

if (inv instanceof ReturnStatementInvocation) {
return false;
}

if (inv instanceof BreakInvocation) {
return false;
}

if (inv instanceof ContinueInvocation) {
return false;
}

if (!(inv instanceof BinaryOperatorInvocationImpl)) {
return false;
return true;
}

BinaryOperatorInvocationImpl boi = (BinaryOperatorInvocationImpl) inv;
Expand Down

0 comments on commit fe5e6e7

Please sign in to comment.