Skip to content

Commit 7c9d20a

Browse files
committed
JS: Implement for TrackedNode to maintain consistency
1 parent a3cf07a commit 7c9d20a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ private module NodeTracking {
5555
pred = succ.getAPredecessor()
5656
or
5757
any(DataFlow::AdditionalFlowStep afs).step(pred, succ)
58+
or
59+
localExceptionStep(pred, succ)
5860
}
5961

6062
/**
@@ -153,9 +155,16 @@ private module NodeTracking {
153155
* which is either an argument or a definition captured by the function, flows,
154156
* possibly through callees.
155157
*/
156-
private predicate flowThroughCall(DataFlow::Node input, DataFlow::Node invk) {
158+
private predicate flowThroughCall(DataFlow::Node input, DataFlow::Node output) {
157159
exists(Function f, DataFlow::ValueNode ret |
158160
ret.asExpr() = f.getAReturnedExpr() and
161+
reachableFromInput(f, output, input, ret, _)
162+
)
163+
or
164+
exists(Function f, DataFlow::Node invk, DataFlow::Node ret |
165+
DataFlow::exceptionalFunctionReturnNode(ret, f) and
166+
DataFlow::exceptionalInvocationReturnNode(output, invk.asExpr()) and
167+
calls(invk, f) and
159168
reachableFromInput(f, invk, input, ret, _)
160169
)
161170
}

0 commit comments

Comments
 (0)