C++: Generate an SEH exception edge for each call inside a SEH block

This commit is contained in:
Jeroen Ketema
2024-12-10 16:36:49 +01:00
parent 400424f13c
commit c7a7447768
4 changed files with 433 additions and 202 deletions

View File

@@ -361,7 +361,12 @@ class TranslatedFunctionCall extends TranslatedCallExpr, TranslatedDirectCall {
not exists(MemberFunction func | expr.getTarget() = func and func.isStatic())
}
final override predicate mayThrowException(ExceptionEdge e) { this.mustThrowException(e) }
final override predicate mayThrowException(ExceptionEdge e) {
this.mustThrowException(e)
or
expr.getEnclosingStmt().getParentStmt*() instanceof MicrosoftTryStmt and
e instanceof SehExceptionEdge
}
final override predicate mustThrowException(ExceptionEdge e) {
expr.getTarget() instanceof AlwaysSehThrowingFunction and