JS: Fix bad join in CallGraphs.qll

This commit is contained in:
Asger F
2025-11-11 14:47:09 +01:00
parent ecfa94600f
commit 578355ac27

View File

@@ -97,9 +97,14 @@ module CallGraph {
not exists(read.getPropertyName()) and not exists(read.getPropertyName()) and
result = read and result = read and
// there exists only local reads of the object, nothing else. // there exists only local reads of the object, nothing else.
forex(DataFlow::Node ref | ref = obj.getALocalUse() and exists(ref.asExpr()) | objectOnlyUsedForPropRead(obj)
ref = [obj, any(DataFlow::PropRead r).getBase()] )
) }
pragma[nomagic]
private predicate objectOnlyUsedForPropRead(DataFlow::ObjectLiteralNode obj) {
forex(DataFlow::Node ref | ref = obj.getALocalUse() and exists(ref.asExpr()) |
ref = [obj, any(DataFlow::PropRead r).getBase()]
) )
} }