JS: Remove allocation site restriction in CG

This commit is contained in:
Asger F
2024-03-01 21:36:29 +01:00
parent ca1a27dc75
commit f5d014baa5

View File

@@ -241,13 +241,8 @@ module CallGraph {
)
}
private DataFlow::FunctionNode getAMethodOnPlainObject(DataFlow::SourceNode node) {
private DataFlow::FunctionNode getAMethodOnObject(DataFlow::SourceNode node) {
(
(
node instanceof DataFlow::ObjectLiteralNode
or
node instanceof DataFlow::FunctionNode
) and
result = node.getAPropertySource()
or
result = node.(DataFlow::ObjectLiteralNode).getPropertyGetter(_)
@@ -258,7 +253,7 @@ module CallGraph {
}
private predicate shouldTrackObjectWithMethods(DataFlow::SourceNode node) {
exists(getAMethodOnPlainObject(node))
exists(getAMethodOnObject(node))
}
/**
@@ -292,7 +287,7 @@ module CallGraph {
predicate impliedReceiverStep(DataFlow::SourceNode pred, DataFlow::SourceNode succ) {
exists(DataFlow::SourceNode host |
pred = getAnAllocationSiteRef(host) and
succ = getAMethodOnPlainObject(host).getReceiver()
succ = getAMethodOnObject(host).getReceiver()
)
}
}