Python: Remove points-to from Expr

This commit is contained in:
Taus
2025-10-30 11:52:39 +00:00
parent b434ce460e
commit b93ce98612
35 changed files with 164 additions and 119 deletions

View File

@@ -13,6 +13,7 @@
*/
import python
private import LegacyPointsTo
predicate typing_import(ImportingStmt is) {
exists(Module m |
@@ -33,7 +34,11 @@ predicate unique_yield(Stmt s) {
/** Holds if `contextlib.suppress` may be used in the same scope as `s` */
predicate suppression_in_scope(Stmt s) {
exists(With w |
w.getContextExpr().(Call).getFunc().pointsTo(Value::named("contextlib.suppress")) and
w.getContextExpr()
.(Call)
.getFunc()
.(ExprWithPointsTo)
.pointsTo(Value::named("contextlib.suppress")) and
w.getScope() = s.getScope()
)
}