File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
go/ql/lib/semmle/go/dataflow/internal Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -807,12 +807,18 @@ module Public {
807807 abstract Node getPreUpdateNode ( ) ;
808808 }
809809
810+ predicate insnHasPostUpdateNode ( IR:: Instruction insn ) {
811+ exists ( Expr e | insn .( IR:: EvalInstruction ) .getExpr ( ) = e |
812+ e instanceof AddressExpr or
813+ e = any ( AddressExpr ae ) .getOperand ( ) or
814+ e = any ( StarExpr ae ) .getBase ( ) or
815+ e = any ( DerefExpr ae ) .getOperand ( ) or
816+ e = any ( IR:: EvalImplicitDerefInstruction eidi ) .getOperand ( )
817+ )
818+ }
819+
810820 predicate hasPostUpdateNode ( Node preupd ) {
811- preupd instanceof AddressOperationNode
812- or
813- preupd = any ( AddressOperationNode addr ) .getOperand ( )
814- or
815- preupd = any ( PointerDereferenceNode deref ) .getOperand ( )
821+ insnHasPostUpdateNode ( preupd .asInstruction ( ) )
816822 or
817823 preupd = getAWrittenNode ( )
818824 or
You can’t perform that action at this time.
0 commit comments