@@ -17,8 +17,16 @@ private import codeql.typetracking.TypeTracking
1717module TypeTracking< TypeTrackingInput I> {
1818 private import I
1919
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+
2028 /** Provides consistency checks for the type-tracker step relations. */
21- module ConsistencyChecks {
29+ module ConsistencyChecks< ConsistencyChecksInputSig ConsistencyChecksInput > {
2230 private predicate stepEntry ( Node n , string kind ) {
2331 simpleLocalSmallStep ( n , _) and kind = "simpleLocalSmallStep"
2432 or
@@ -34,6 +42,7 @@ module TypeTracking<TypeTrackingInput I> {
3442 * `LocalSourceNode`.
3543 */
3644 query predicate unreachableNode ( Node n , string msg ) {
45+ not ConsistencyChecksInput:: unreachableNodeExclude ( n ) and
3746 exists ( string kind |
3847 stepEntry ( n , kind ) and
3948 not flowsTo ( _, n ) and
@@ -46,6 +55,7 @@ module TypeTracking<TypeTrackingInput I> {
4655 * backtracking store target feature isn't enabled.
4756 */
4857 query predicate nonSourceStoreTarget ( Node n , string msg ) {
58+ not ConsistencyChecksInput:: nonSourceStoreTargetExclude ( n ) and
4959 not hasFeatureBacktrackStoreTarget ( ) and
5060 not n instanceof LocalSourceNode and
5161 ( storeStep ( _, n , _) or loadStoreStep ( _, n , _, _) ) and
0 commit comments