Skip to content

Commit 2fb1084

Browse files
committed
JS: Only parameter-calls as lambda calls
1 parent 1e9e57e commit 2fb1084

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

javascript/ql/lib/semmle/javascript/dataflow/internal/DataFlowPrivate.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,9 @@ predicate lambdaCreation(Node creation, LambdaCallKind kind, DataFlowCallable c)
15301530
predicate lambdaCall(DataFlowCall call, LambdaCallKind kind, Node receiver) {
15311531
call.isSummaryCall(_, receiver.(FlowSummaryNode).getSummaryNode()) and exists(kind)
15321532
or
1533-
receiver = call.asOrdinaryCall().getCalleeNode() and exists(kind)
1533+
receiver = call.asOrdinaryCall().getCalleeNode() and
1534+
exists(kind) and
1535+
receiver.getALocalSource() instanceof DataFlow::ParameterNode
15341536
}
15351537

15361538
/** Extra data-flow steps needed for lambda flow analysis. */

0 commit comments

Comments
 (0)