Skip to content

Commit 4942608

Browse files
committed
C++: Generate an SEH exception edge for each call inside a SEH block
1 parent 5d67381 commit 4942608

File tree

4 files changed

+433
-202
lines changed

4 files changed

+433
-202
lines changed

Diff for: cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedCall.qll

+6-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,12 @@ class TranslatedFunctionCall extends TranslatedCallExpr, TranslatedDirectCall {
361361
not exists(MemberFunction func | expr.getTarget() = func and func.isStatic())
362362
}
363363

364-
final override predicate mayThrowException(ExceptionEdge e) { this.mustThrowException(e) }
364+
final override predicate mayThrowException(ExceptionEdge e) {
365+
this.mustThrowException(e)
366+
or
367+
expr.getEnclosingStmt().getParentStmt*() instanceof MicrosoftTryStmt and
368+
e instanceof SehExceptionEdge
369+
}
365370

366371
final override predicate mustThrowException(ExceptionEdge e) {
367372
expr.getTarget() instanceof AlwaysSehThrowingFunction and

0 commit comments

Comments
 (0)