@@ -1596,12 +1596,23 @@ private Cpp::Stmt getAChainedBranch(Cpp::IfStmt s) {
1596
1596
)
1597
1597
}
1598
1598
1599
- private Instruction getInstruction ( Node n ) {
1600
- result = n .asInstruction ( ) or
1601
- result = n .asOperand ( ) .getUse ( ) or
1602
- result = n .( SsaPhiNode ) .getPhiNode ( ) .getBasicBlock ( ) .getFirstInstruction ( ) or
1603
- n .( IndirectInstruction ) .hasInstructionAndIndirectionIndex ( result , _) or
1604
- result = getInstruction ( n .( PostUpdateNode ) .getPreUpdateNode ( ) )
1599
+ private Instruction getAnInstruction ( Node n ) {
1600
+ result = n .asInstruction ( )
1601
+ or
1602
+ not n instanceof InstructionNode and
1603
+ result = n .asOperand ( ) .getUse ( )
1604
+ or
1605
+ result = n .( SsaPhiNode ) .getPhiNode ( ) .getBasicBlock ( ) .getFirstInstruction ( )
1606
+ or
1607
+ n .( IndirectInstruction ) .hasInstructionAndIndirectionIndex ( result , _)
1608
+ or
1609
+ not n instanceof IndirectInstruction and
1610
+ exists ( Operand operand |
1611
+ n .( IndirectOperand ) .hasOperandAndIndirectionIndex ( operand , _) and
1612
+ result = operand .getUse ( )
1613
+ )
1614
+ or
1615
+ result = getAnInstruction ( n .( PostUpdateNode ) .getPreUpdateNode ( ) )
1605
1616
}
1606
1617
1607
1618
private newtype TDataFlowSecondLevelScope =
@@ -1647,7 +1658,7 @@ class DataFlowSecondLevelScope extends TDataFlowSecondLevelScope {
1647
1658
1648
1659
/** Gets a data-flow node nested within this scope. */
1649
1660
Node getANode ( ) {
1650
- getInstruction ( result ) .getAst ( ) .( Cpp:: ControlFlowNode ) .getEnclosingStmt ( ) .getParentStmt * ( ) =
1661
+ getAnInstruction ( result ) .getAst ( ) .( Cpp:: ControlFlowNode ) .getEnclosingStmt ( ) .getParentStmt * ( ) =
1651
1662
this .getAStmt ( )
1652
1663
}
1653
1664
}
0 commit comments