File tree 1 file changed +18
-0
lines changed
shared/dataflow/codeql/dataflow/internal
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> {
224
224
hasFilteredSource ( )
225
225
)
226
226
}
227
+
228
+ bindingset [ source, sink]
229
+ pragma [ inline_late]
230
+ predicate isRelevantSourceSinkPair ( Node source , Node sink ) {
231
+ isFilteredSource ( source ) or
232
+ isFilteredSink ( sink )
233
+ }
227
234
}
228
235
229
236
private import SourceSinkFiltering
@@ -3511,6 +3518,17 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
3511
3518
* included in the module `PathGraph`.
3512
3519
*/
3513
3520
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
3514
3532
exists ( PathNodeImpl flowsource , PathNodeImpl flowsink |
3515
3533
source = flowsource and sink = flowsink
3516
3534
|
You can’t perform that action at this time.
0 commit comments