Skip to content

Commit 1e83aa2

Browse files
committed
JS: Fix bad join in CallGraphs.qll
1 parent b9c4636 commit 1e83aa2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

javascript/ql/lib/semmle/javascript/dataflow/internal/CallGraphs.qll

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,14 @@ module CallGraph {
9797
not exists(read.getPropertyName()) and
9898
result = read and
9999
// there exists only local reads of the object, nothing else.
100-
forex(DataFlow::Node ref | ref = obj.getALocalUse() and exists(ref.asExpr()) |
101-
ref = [obj, any(DataFlow::PropRead r).getBase()]
102-
)
100+
objectOnlyUsedForPropRead(obj)
101+
)
102+
}
103+
104+
pragma[nomagic]
105+
private predicate objectOnlyUsedForPropRead(DataFlow::ObjectLiteralNode obj) {
106+
forex(DataFlow::Node ref | ref = obj.getALocalUse() and exists(ref.asExpr()) |
107+
ref = [obj, any(DataFlow::PropRead r).getBase()]
103108
)
104109
}
105110

0 commit comments

Comments
 (0)