Skip to content

Commit 926f2c1

Browse files
committed
require that a write must dominate the enclosing stmt of a read
1 parent 55565a5 commit 926f2c1

File tree

3 files changed

+253
-2
lines changed

3 files changed

+253
-2
lines changed

javascript/ql/src/semmle/javascript/GlobalAccessPaths.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ module AccessPath {
444444
ref = getAccessTo(root, path, _) and
445445
ref.getBasicBlock() = bb
446446
|
447-
ref order by any(int i | ref.asExpr() = bb.getNode(i))
447+
ref order by any(int i | ref.asExpr().getEnclosingStmt() = bb.getNode(i))
448448
) and
449449
result = getAccessTo(root, path, type)
450450
}
@@ -489,7 +489,7 @@ module AccessPath {
489489
// across basic blocks.
490490
exists(Root root, string path |
491491
read = getAccessTo(root, path, AccessPathRead()) and
492-
getAWriteBlock(root, path).strictlyDominates(read.getBasicBlock())
492+
getAWriteBlock(root, path).strictlyDominates(read.asExpr().getEnclosingStmt().getBasicBlock())
493493
)
494494
}
495495
}

0 commit comments

Comments
 (0)