File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
shared/dataflow/codeql/dataflow/internal Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,13 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
224224 hasFilteredSource ( )
225225 )
226226 }
227+
228+ bindingset [ source, sink]
229+ pragma [ inline_late]
230+ predicate isRelevantSourceSinkPair ( Node source , Node sink ) {
231+ isFilteredSource ( source ) or
232+ isFilteredSink ( sink )
233+ }
227234 }
228235
229236 private import SourceSinkFiltering
@@ -3511,6 +3518,17 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
35113518 * included in the module `PathGraph`.
35123519 */
35133520 predicate flowPath ( PathNode source , PathNode sink ) {
3521+ (
3522+ // When there are both sources and sinks in the diff range,
3523+ // diff-informed dataflow falls back to computing all paths without
3524+ // any filtering. To prevent significant alert flip-flopping due to
3525+ // minor code changes triggering the fallback, we consistently apply
3526+ // source-or-sink filtering here to ensure that we return the same
3527+ // paths regardless of whether the fallback is triggered.
3528+ if Config:: observeDiffInformedIncrementalMode ( )
3529+ then isRelevantSourceSinkPair ( source .getNode ( ) , sink .getNode ( ) )
3530+ else any ( )
3531+ ) and
35143532 exists ( PathNodeImpl flowsource , PathNodeImpl flowsink |
35153533 source = flowsource and sink = flowsink
35163534 |
You can’t perform that action at this time.
0 commit comments