mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
JS: Prevent bad join ordering
This commit is contained in:
@@ -737,12 +737,17 @@ module TaintTracking {
|
||||
read = getAStaticCaptureRef()
|
||||
or
|
||||
exists(ControlFlowNode mid |
|
||||
mid = getANodeReachingCaptureRef(read) and
|
||||
not mid = getACaptureSetter(_) and
|
||||
result = mid.getAPredecessor()
|
||||
result = getANodeReachingCaptureRefAux(read, mid) and
|
||||
not mid = getACaptureSetter(_)
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private ControlFlowNode getANodeReachingCaptureRefAux(DataFlow::PropRead read, ControlFlowNode mid) {
|
||||
mid = getANodeReachingCaptureRef(read) and
|
||||
result = mid.getAPredecessor()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if there is a step `pred -> succ` from the input of a RegExp match to
|
||||
* a static property of `RegExp` defined.
|
||||
|
||||
Reference in New Issue
Block a user