Merge pull request #18315 from hvitved/ruby/dataflow-types

Ruby: Track types in data flow
This commit is contained in:
Tom Hvitved
2025-01-08 15:26:38 +01:00
committed by GitHub
40 changed files with 9610 additions and 8845 deletions

View File

@@ -14,6 +14,9 @@ signature module InputSig<LocationSig Location, DF::InputSig<Location> DataFlowL
/** Holds if `call` should be excluded from the consistency test `uniqueCallEnclosingCallable`. */
default predicate uniqueCallEnclosingCallableExclude(DataFlowLang::DataFlowCall call) { none() }
/** Holds if `n` should be excluded from the consistency test `uniqueType`. */
default predicate uniqueTypeExclude(DataFlowLang::Node n) { none() }
/** Holds if `n` should be excluded from the consistency test `uniqueNodeLocation`. */
default predicate uniqueNodeLocationExclude(DataFlowLang::Node n) { none() }
@@ -123,6 +126,7 @@ module MakeConsistency<
n instanceof RelevantNode and
c = count(getNodeType(n)) and
c != 1 and
not Input::uniqueTypeExclude(n) and
msg = "Node should have one type but has " + c + "."
)
}