[PATCH] D102280: [analyzer] Engine: fix crash with SEH __leave keyword
Abbas Sabra via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 14 02:50:56 PDT 2021
AbbasSabra updated this revision to Diff 345381.
AbbasSabra added a comment.
Updating D102280 <https://reviews.llvm.org/D102280>: [analyzer] Apply code review
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102280/new/
https://reviews.llvm.org/D102280
Files:
clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
clang/test/Analysis/misc-ms-leave.cpp
Index: clang/test/Analysis/misc-ms-leave.cpp
===================================================================
--- /dev/null
+++ clang/test/Analysis/misc-ms-leave.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -triple x86_64-pc-windows-msvc19.11.0 -fms-extensions -verify %s
+
+void clang_analyzer_warnIfReached();
+int filter();
+
+void try_except_leave() {
+ __try {
+ __leave; // no-crash
+ } __except (filter()) {
+ }
+ clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
+}
Index: clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
+++ clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
@@ -349,6 +349,7 @@
HandleBranch(cast<ForStmt>(Term)->getCond(), Term, B, Pred);
return;
+ case Stmt::SEHLeaveStmtClass:
case Stmt::ContinueStmtClass:
case Stmt::BreakStmtClass:
case Stmt::GotoStmtClass:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102280.345381.patch
Type: text/x-patch
Size: 1015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210514/1beeeb35/attachment-0001.bin>
More information about the cfe-commits
mailing list