Skip to content

Commit cd62cda

Browse files
committed
Python: Fix bad join in returnStep
1 parent 304cd12 commit cd62cda

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/TypeTrackingImpl.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,18 @@ module TypeTrackingInput implements Shared::TypeTrackingInput<Location> {
202202
*/
203203
predicate returnStep(Node nodeFrom, LocalSourceNode nodeTo) {
204204
exists(DataFlowPrivate::ExtractedDataFlowCall call |
205-
nodeFrom.(DataFlowPrivate::ReturnNode).getEnclosingCallable() = call.getCallable() and
205+
returnNodeEnclosingCallable(nodeFrom) = call.getCallable() and
206206
nodeTo.(DataFlowPublic::CfgNode).getNode() = call.getNode()
207207
)
208208
}
209209

210+
pragma[nomagic]
211+
private DataFlowDispatch::DataFlowCallable returnNodeEnclosingCallable(
212+
DataFlowPrivate::ReturnNode returnNode
213+
) {
214+
result = returnNode.getEnclosingCallable()
215+
}
216+
210217
/**
211218
* Holds if `nodeFrom` is being written to the `content` content of the object in `nodeTo`.
212219
*/

0 commit comments

Comments
 (0)