Merge pull request #10266 from yoff/python/port-CatchingBaseException

Approved by tausbn
This commit is contained in:
CodeQL CI
2022-09-19 00:50:05 -07:00
committed by GitHub

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())
}