mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
JS: Remove allocation site restriction in CG
This commit is contained in:
@@ -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()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user