Skip to content

Commit 4d33407

Browse files
committed
optimize getACalleeValue
1 parent 47f4faa commit 4d33407

File tree

1 file changed

+7
-1
lines changed
  • javascript/ql/src/semmle/javascript/dataflow

1 file changed

+7
-1
lines changed

javascript/ql/src/semmle/javascript/dataflow/Nodes.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,13 @@ class InvokeNode extends DataFlow::SourceNode {
168168
private ObjectLiteralNode getOptionsArgument(int i) { result.flowsTo(getArgument(i)) }
169169

170170
/** Gets an abstract value representing possible callees of this call site. */
171-
final AbstractValue getACalleeValue() { result = getCalleeNode().analyze().getAValue() }
171+
final AbstractValue getACalleeValue() {
172+
exists(DataFlow::Node callee, DataFlow::AnalyzedNode analyzed |
173+
pragma[only_bind_into](callee) = getCalleeNode() and
174+
pragma[only_bind_into](analyzed) = callee.analyze() and
175+
pragma[only_bind_into](result) = analyzed.getAValue()
176+
)
177+
}
172178

173179
/**
174180
* Gets a potential callee of this call site.

0 commit comments

Comments
 (0)