Skip to content

Commit d102a84

Browse files
committed
python: replace points-to with API graph
1 parent 2223bc3 commit d102a84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/ql/src/Exceptions/CatchingBaseException.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
*/
1414

1515
import python
16+
import semmle.python.ApiGraphs
1617

1718
predicate doesnt_reraise(ExceptStmt ex) { ex.getAFlowNode().getBasicBlock().reachesExit() }
1819

1920
predicate catches_base_exception(ExceptStmt ex) {
20-
ex.getType().pointsTo(ClassValue::baseException())
21+
ex.getType() = API::builtin("BaseException").getAValueReachableFromSource().asExpr()
2122
or
2223
not exists(ex.getType())
2324
}

0 commit comments

Comments
 (0)