Skip to content

Commit 987ce9b

Browse files
committed
Java: update to reflect changes in VariableCapture.qll
1 parent ca2d18d commit 987ce9b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ private module CaptureInput implements VariableCapture::InputSig {
114114

115115
CapturedVariable getVariable() { result = v }
116116

117-
Expr getSource() {
118-
result = this.(VariableAssign).getSource() or
119-
result = this.(AssignOp)
117+
Node getSource() {
118+
result.asExpr() = this.(VariableAssign).getSource() or
119+
result.asExpr() = this.(AssignOp)
120120
}
121121
}
122122

@@ -162,7 +162,8 @@ private CaptureFlow::ClosureNode asClosureNode(Node n) {
162162
result.(CaptureFlow::ParameterNode).getParameter() = n.asParameter() or
163163
result.(CaptureFlow::ThisParameterNode).getCallable() = n.(InstanceParameterNode).getCallable() or
164164
exprNode(result.(CaptureFlow::MallocNode).getClosureExpr()).(PostUpdateNode).getPreUpdateNode() =
165-
n
165+
n or
166+
result.(CaptureFlow::VariableWriteSourceNode).getVariableWrite().getSource() = n
166167
}
167168

168169
private predicate captureStoreStep(Node node1, CapturedVariableContent c, Node node2) {

0 commit comments

Comments
 (0)