@@ -217,9 +217,12 @@ public bool isSkipableStatement(stmtArgument) {
217217}
218218
219219public Node replacePhiFunctionVersion (map [Node , list [Node ]] blockTree , Node variableNode ) {
220- assignStatement = returnStmtNodeBody (variableNode );
221- assign (assignVariable , assignPhiFunction ) = assignStatement ;
222- phiFunction (phiFunctionVariable , variableVersionList ) = assignPhiFunction ;
220+ assignVariable = returnLeftHandSideVariable (variableNode );
221+ assignPhiFunction = returnRightHandSideExpression (variableNode );
222+
223+ phiFunctionVariable = returnPhiFunctionLeftHandSide (assignPhiFunction );
224+ variableVersionList = returnPhiFunctionRightHandSide (assignPhiFunction );
225+
223226 variableName = phiFunctionVariable [0 ];
224227 Immediate localVariableImmediate = local (variableName );
225228 versionIndex = getVariableVersionStacked (localVariableImmediate );
@@ -274,7 +277,7 @@ public String returnCurrentVersionName(Immediate immediate) {
274277public bool isRenamed (Node assignNode ) {
275278 if (ignoreNode (assignNode )) return false ;
276279
277- stmtNode ( assignStmt ) = assignNode ;
280+ assignStmt = returnStmtNodeBody ( assignNode ) ;
278281
279282 switch (assignNode ) {
280283 case stmtNode (assign (localVariable (name ), _)) : return contains (name , "version" );
@@ -310,7 +313,7 @@ public bool ignoreNode(Node variableNode) {
310313public bool isOrdinaryAssignment (Node variableNode ) {
311314 if (ignoreNode (variableNode )) return false ;
312315
313- stmtNode ( statement ) = variableNode ;
316+ statement = returnStmtNodeBody ( variableNode ) ;
314317 switch (statement ) {
315318 case assign (_, _): return true ;
316319 default : return false ;
@@ -320,7 +323,7 @@ public bool isOrdinaryAssignment(Node variableNode) {
320323public bool isPhiFunctionAssigment (Node variableNode ) {
321324 if (ignoreNode (variableNode )) return false ;
322325
323- stmtNode ( assignStatement ) = variableNode ;
326+ assignStatement = returnStmtNodeBody ( variableNode ) ;
324327 if (size (assignStatement [..]) != 2 ) return false ;
325328
326329 possiblePhiFunction = assignStatement [1 ];
@@ -334,7 +337,7 @@ public bool isPhiFunctionAssigment(Node variableNode) {
334337public bool isVariable (Node graphNode ) {
335338 if (size (graphNode [..]) == 0 ) return false ;
336339
337- stmtNode ( assignStatement ) = graphNode ;
340+ assignStatement = returnStmtNodeBody ( graphNode ) ;
338341 variableArg = assignStatement [0 ];
339342 typeOfVariableArg = typeOf (variableArg );
340343
@@ -346,7 +349,7 @@ public bool isVariable(Node graphNode) {
346349public bool isSameVariable (Node graphNode , Variable variable ) {
347350 if (size (graphNode [..]) == 0 ) return false ;
348351
349- stmtNode ( assignStatement ) = graphNode ;
352+ assignStatement = returnStmtNodeBody ( graphNode ) ;
350353 variableArg = assignStatement [0 ];
351354 typeOfVariableArg = typeOf (variableArg );
352355
0 commit comments