File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
cpp/ql/src/semmle/code/cpp/models/interfaces Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -50,5 +50,16 @@ abstract class AliasFunction extends Function {
50
50
/**
51
51
* Holds if the function always returns the value of the parameter at the specified index.
52
52
*/
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
+ }
54
65
}
You can’t perform that action at this time.
0 commit comments