python: replace points-to with API graph

This commit is contained in:
Rasmus Lerchedahl Petersen
2022-09-01 22:58:46 +02:00
parent 2223bc3d1f
commit d102a84e02

View File

@@ -13,11 +13,12 @@
*/
import python
import semmle.python.ApiGraphs
predicate doesnt_reraise(ExceptStmt ex) { ex.getAFlowNode().getBasicBlock().reachesExit() }
predicate catches_base_exception(ExceptStmt ex) {
ex.getType().pointsTo(ClassValue::baseException())
ex.getType() = API::builtin("BaseException").getAValueReachableFromSource().asExpr()
or
not exists(ex.getType())
}