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,10 +97,15 @@ module CallGraph {
not exists(read.getPropertyName()) and
result = read and
// there exists only local reads of the object, nothing else.
objectOnlyUsedForPropRead(obj)
)
}
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()]
)
)
}
private predicate locallyReturnedFunction(