Skip to content

Commit f4f8c6e

Browse files
committed
Python: Swaps out element_from_tuple
1 parent 2bcd8c8 commit f4f8c6e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

python/ql/src/semmle/python/types/Exceptions.qll

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ class ExceptFlowNode extends ControlFlowNode {
274274
(
275275
this.getType().pointsTo(val, origin)
276276
or
277-
exists(Value tup |
278-
this.handledObject(val, ClassValue::tuple(), _) |
279-
element_from_tuple(tup).pointsTo(val, origin)
277+
exists(TupleValue tup |
278+
this.handledObject(tup, ClassValue::tuple(), _) |
279+
val = tup.getItem(_) and origin.pointsTo(val)
280280
)
281281
)
282282
}
@@ -317,12 +317,6 @@ private ControlFlowNode element_from_tuple_objectapi(Object tuple) {
317317
)
318318
}
319319

320-
private ControlFlowNode element_from_tuple(Value tuple) {
321-
exists(Expr x, Tuple t |
322-
x.pointsTo(tuple,t) and result = t.getAnElt().getAFlowNode()
323-
)
324-
}
325-
326320
/** A Reraising node is the node at the end of a finally block (on the exceptional branch)
327321
* that reraises the current exception.
328322
*/

0 commit comments

Comments
 (0)