File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp/models/interfaces Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,5 +50,16 @@ abstract class AliasFunction extends Function {
5050 /**
5151 * Holds if the function always returns the value of the parameter at the specified index.
5252 */
53- abstract predicate parameterIsAlwaysReturned ( int index ) ;
53+ predicate parameterIsAlwaysReturned ( int index ) { none ( ) }
54+
55+ /**
56+ * Holds if the address passed in via `input` is always propagated to `output`.
57+ */
58+ predicate hasAddressFlow ( FunctionInput input , FunctionOutput output ) {
59+ exists ( int index |
60+ // By default, just use the old `parameterIsAlwaysReturned` predicate to detect flow from the
61+ // parameter to the return value.
62+ input .isParameter ( index ) and output .isReturnValue ( ) and this .parameterIsAlwaysReturned ( index )
63+ )
64+ }
5465}
You can’t perform that action at this time.
0 commit comments