File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -135,18 +135,24 @@ module ParameterSinks {
135
135
}
136
136
}
137
137
138
- predicate isUse ( DataFlow:: Node n , Expr e ) {
139
- isUse0 ( n , e )
140
- or
141
- exists ( CallInstruction call , int i , InitializeParameterInstruction init |
142
- n .asOperand ( ) .getDef ( ) .getUnconvertedResultExpression ( ) = e and
143
- init = ParameterSinks:: getAnAlwaysDereferencedParameter ( ) and
144
- call .getArgumentOperand ( i ) = n .asOperand ( ) and
145
- init .hasIndex ( i ) and
146
- init .getEnclosingFunction ( ) = call .getStaticCallTarget ( )
147
- )
138
+ module IsUse {
139
+ private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplCommon
140
+
141
+ predicate isUse ( DataFlow:: Node n , Expr e ) {
142
+ isUse0 ( n , e )
143
+ or
144
+ exists ( CallInstruction call , InitializeParameterInstruction init |
145
+ n .asOperand ( ) .getDef ( ) .getUnconvertedResultExpression ( ) = e and
146
+ pragma [ only_bind_into ] ( init ) = ParameterSinks:: getAnAlwaysDereferencedParameter ( ) and
147
+ viableParamArg ( call , DataFlow:: instructionNode ( init ) , n ) and
148
+ pragma [ only_bind_out ] ( init .getEnclosingFunction ( ) ) =
149
+ pragma [ only_bind_out ] ( call .getStaticCallTarget ( ) )
150
+ )
151
+ }
148
152
}
149
153
154
+ import IsUse
155
+
150
156
/**
151
157
* `dealloc1` is a deallocation expression, `e` is an expression that dereferences a
152
158
* pointer, and the `(dealloc1, e)` pair should be excluded by the `FlowFromFree` library.
You can’t perform that action at this time.
0 commit comments