mirror of
https://github.com/github/codeql.git
synced 2026-05-24 16:17:07 +02:00
JS: Improve performance of DominatingPaths::hasDominatingWrite
Check that the read node is in a *reachable* basic block before looking for a dominating write block.
This commit is contained in:
committed by
Henry Mercer
parent
ee97acefcd
commit
e60c8470a3
@@ -565,9 +565,12 @@ module AccessPath {
|
||||
)
|
||||
or
|
||||
// across basic blocks.
|
||||
exists(Root root, string path |
|
||||
exists(Root root, string path, ReachableBasicBlock readBlock |
|
||||
read.asExpr() = getAccessTo(root, path, AccessPathRead()) and
|
||||
getAWriteBlock(root, path).strictlyDominates(read.getBasicBlock())
|
||||
readBlock = read.getBasicBlock() and
|
||||
// Performance optimisation: check that `read` is in a *reachable* basic block
|
||||
// before looking for a dominating write block.
|
||||
getAWriteBlock(root, path).strictlyDominates(pragma[only_bind_out](readBlock))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user