@@ -760,18 +760,27 @@ module Public {
760760 predicate isReceiverOf ( MethodDecl m ) { parm .isReceiverOf ( m ) }
761761 }
762762
763- private Node getADirectlyWrittenNode ( ) {
764- exists ( Write w | w .writesComponent ( result , _) ) or
765- result = DataFlow:: exprNode ( any ( SendStmt s ) .getChannel ( ) )
763+ private IR:: Instruction getADirectlyWrittenInsn ( ) {
764+ exists ( Write w | w .writesComponentInstruction ( result , _) )
765+ or
766+ result = IR:: evalExprInstruction ( any ( SendStmt s ) .getChannel ( ) )
766767 }
767768
768- private DataFlow:: Node getAccessPathPredecessor ( DataFlow:: Node node ) {
769- result = node .( PointerDereferenceNode ) .getOperand ( )
769+ private IR:: Instruction getAccessPathPredecessorInsn ( IR:: Instruction insn ) {
770+ exists ( Expr e1 , Expr e2 |
771+ insn = IR:: evalExprInstruction ( e1 ) and result = IR:: evalExprInstruction ( e2 )
772+ |
773+ e2 = e1 .( DerefExpr ) .getOperand ( ) or e2 = e1 .( StarExpr ) .getBase ( )
774+ )
770775 or
771- result = node .( ComponentReadNode ) .getBase ( )
776+ exists ( Expr e | insn = IR:: implicitDerefInstruction ( e ) and result = IR:: evalExprInstruction ( e ) )
777+ or
778+ result = insn .( IR:: ComponentReadInstruction ) .getBase ( )
772779 }
773780
774- private Node getAWrittenNode ( ) { result = getAccessPathPredecessor * ( getADirectlyWrittenNode ( ) ) }
781+ private IR:: Instruction getAWrittenInsn ( ) {
782+ result = getAccessPathPredecessorInsn * ( getADirectlyWrittenInsn ( ) )
783+ }
775784
776785 /**
777786 * Holds if `tp` is a type that may (directly or indirectly) reference a memory location.
@@ -831,14 +840,12 @@ module Public {
831840 )
832841 ) and
833842 mutableType ( insn .getResultType ( ) )
834- }
835-
836- predicate hasPostUpdateNode ( Node preupd ) {
837- insnHasPostUpdateNode ( preupd .asInstruction ( ) )
838843 or
839- preupd = getAWrittenNode ( )
844+ insn = getAWrittenInsn ( )
840845 }
841846
847+ predicate hasPostUpdateNode ( Node preupd ) { insnHasPostUpdateNode ( preupd .asInstruction ( ) ) }
848+
842849 private class DefaultPostUpdateNode extends PostUpdateNode {
843850 Node preupd ;
844851
0 commit comments