Skip to content

Commit f541c8b

Browse files
committed
JS: Treat steps between SourceNodes as LevelStep()
1 parent 938938c commit f541c8b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ private module Cached {
6767
*/
6868
cached
6969
predicate step(DataFlow::SourceNode pred, DataFlow::SourceNode succ, StepSummary summary) {
70-
exists(DataFlow::Node mid | pred.flowsTo(mid) | StepSummary::smallstep(mid, succ, summary))
70+
exists(DataFlow::Node mid |
71+
pred.flowsTo(mid) and
72+
StepSummary::smallstep(mid, succ, summary) and
73+
(pred = mid or not mid instanceof DataFlow::SourceNode)
74+
)
75+
or
76+
pred.flowsTo(succ) and summary = LevelStep() and pred != succ
7177
}
7278

7379
pragma[nomagic]

0 commit comments

Comments
 (0)