mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
Python: Fix another bad TC.
This one is a bit awkward, since the previous version was supposed to improve indexing. Unfortunately this is vastly outweighed by the slow convergence of the TC. Right now we pay the cost of inverting the `hasFlowSource` relation, but this is still cheaper.
This commit is contained in:
@@ -530,15 +530,12 @@ private module Cached {
|
||||
* The slightly backwards parametering ordering is to force correct indexing.
|
||||
*/
|
||||
cached
|
||||
predicate hasLocalSource(Node sink, Node source) {
|
||||
// Declaring `source` to be a `SourceNode` currently causes a redundant check in the
|
||||
// recursive case, so instead we check it explicitly here.
|
||||
source = sink and
|
||||
source instanceof LocalSourceNode
|
||||
predicate hasLocalSource(Node sink, LocalSourceNode source) {
|
||||
source = sink
|
||||
or
|
||||
exists(Node mid |
|
||||
hasLocalSource(mid, source) and
|
||||
simpleLocalFlowStep(mid, sink)
|
||||
exists(Node second |
|
||||
simpleLocalFlowStep(source, second) and
|
||||
simpleLocalFlowStep*(second, sink)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user