File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
cpp/ql/src/semmle/code/cpp Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,16 @@ class FunctionInput extends TFunctionInput {
132132 * part of itself, or one of its other inputs.
133133 */
134134 predicate isReturnValueDeref ( ) { none ( ) }
135+
136+ /**
137+ * Holds if `i >= 0` and `isParameterDeref(i)` holds for this is value, or
138+ * if `i = -1` and `isQualifierObject()` holds for this value.
139+ */
140+ final predicate isParameterDerefOrQualifierObject ( ParameterIndex i ) {
141+ i >= 0 and this .isParameterDeref ( i )
142+ or
143+ i = - 1 and this .isQualifierObject ( )
144+ }
135145}
136146
137147/**
@@ -370,6 +380,16 @@ class FunctionOutput extends TFunctionOutput {
370380 * DEPRECATED: Use `isReturnValueDeref()` instead.
371381 */
372382 deprecated final predicate isOutReturnPointer ( ) { isReturnValueDeref ( ) }
383+
384+ /**
385+ * Holds if `i >= 0` and `isParameterDeref(i)` holds for this is the value, or
386+ * if `i = -1` and `isQualifierObject()` holds for this value.
387+ */
388+ final predicate isParameterDerefOrQualifierObject ( ParameterIndex i ) {
389+ i >= 0 and this .isParameterDeref ( i )
390+ or
391+ i = - 1 and this .isQualifierObject ( )
392+ }
373393}
374394
375395/**
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ private class RemoteParameterSource extends RemoteFlowSource {
4646 asInstruction ( ) = instr and
4747 instr .getPrimaryInstruction ( ) .( CallInstruction ) .getStaticCallTarget ( ) = func and
4848 func .hasRemoteFlowSource ( output , sourceType ) and
49- output .isParameterDeref ( instr .getIndex ( ) )
49+ output .isParameterDerefOrQualifierObject ( instr .getIndex ( ) )
5050 )
5151 }
5252
@@ -80,7 +80,7 @@ private class LocalParameterSource extends LocalFlowSource {
8080 asInstruction ( ) = instr and
8181 instr .getPrimaryInstruction ( ) .( CallInstruction ) .getStaticCallTarget ( ) = func and
8282 func .hasLocalFlowSource ( output , sourceType ) and
83- output .isParameterDeref ( instr .getIndex ( ) )
83+ output .isParameterDerefOrQualifierObject ( instr .getIndex ( ) )
8484 )
8585 }
8686
You can’t perform that action at this time.
0 commit comments