@@ -29,9 +29,8 @@ private predicate externalCallNeverDereferences(FormattingFunctionCall call, int
29
29
)
30
30
}
31
31
32
- predicate isUse0 ( DataFlow:: Node n , Expr e ) {
33
- e = n .asExpr ( ) and
34
- not isFree ( n , _, _) and
32
+ predicate isUse0 ( Expr e ) {
33
+ not isFree ( _, e , _) and
35
34
(
36
35
e = any ( PointerDereferenceExpr pde ) .getOperand ( )
37
36
or
@@ -57,7 +56,7 @@ module ParameterSinks {
57
56
import semmle.code.cpp.ir.ValueNumbering
58
57
59
58
predicate flowsToUse ( DataFlow:: Node n ) {
60
- isUse0 ( n , _ )
59
+ isUse0 ( n . asExpr ( ) )
61
60
or
62
61
exists ( DataFlow:: Node succ |
63
62
flowsToUse ( succ ) and
@@ -90,7 +89,7 @@ module ParameterSinks {
90
89
) {
91
90
pragma [ only_bind_out ] ( source .asParameter ( ) ) = pragma [ only_bind_out ] ( init .getParameter ( ) ) and
92
91
paramToUse ( source , sink ) and
93
- isUse0 ( sink , _ )
92
+ isUse0 ( sink . asExpr ( ) )
94
93
}
95
94
96
95
private InitializeParameterInstruction getAnAlwaysDereferencedParameter0 ( ) {
@@ -139,7 +138,7 @@ module IsUse {
139
138
private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplCommon
140
139
141
140
predicate isUse ( DataFlow:: Node n , Expr e ) {
142
- isUse0 ( n , e )
141
+ isUse0 ( e ) and n . asExpr ( ) = e
143
142
or
144
143
exists ( CallInstruction call , InitializeParameterInstruction init |
145
144
n .asOperand ( ) .getDef ( ) .getUnconvertedResultExpression ( ) = e and
0 commit comments