@@ -17,8 +17,16 @@ private import codeql.typetracking.TypeTracking
17
17
module TypeTracking< TypeTrackingInput I> {
18
18
private import I
19
19
20
+ signature module ConsistencyChecksInputSig {
21
+ /** Holds if `n` should be excluded from the consistency test `unreachableNode`. */
22
+ default predicate unreachableNodeExclude ( Node n ) { none ( ) }
23
+
24
+ /** Holds if `n` should be excluded from the consistency test `nonSourceStoreTarget`. */
25
+ default predicate nonSourceStoreTargetExclude ( Node n ) { none ( ) }
26
+ }
27
+
20
28
/** Provides consistency checks for the type-tracker step relations. */
21
- module ConsistencyChecks {
29
+ module ConsistencyChecks< ConsistencyChecksInputSig ConsistencyChecksInput > {
22
30
private predicate stepEntry ( Node n , string kind ) {
23
31
simpleLocalSmallStep ( n , _) and kind = "simpleLocalSmallStep"
24
32
or
@@ -34,6 +42,7 @@ module TypeTracking<TypeTrackingInput I> {
34
42
* `LocalSourceNode`.
35
43
*/
36
44
query predicate unreachableNode ( Node n , string msg ) {
45
+ not ConsistencyChecksInput:: unreachableNodeExclude ( n ) and
37
46
exists ( string kind |
38
47
stepEntry ( n , kind ) and
39
48
not flowsTo ( _, n ) and
@@ -46,6 +55,7 @@ module TypeTracking<TypeTrackingInput I> {
46
55
* backtracking store target feature isn't enabled.
47
56
*/
48
57
query predicate nonSourceStoreTarget ( Node n , string msg ) {
58
+ not ConsistencyChecksInput:: nonSourceStoreTargetExclude ( n ) and
49
59
not hasFeatureBacktrackStoreTarget ( ) and
50
60
not n instanceof LocalSourceNode and
51
61
( storeStep ( _, n , _) or loadStoreStep ( _, n , _, _) ) and
0 commit comments