This revision was automatically updated to reflect the committed changes. Closed by commit rGebcf030efc5e: [analyzer] Engine: fix crash with SEH __leave keyword (authored by AbbasSabra, committed by steakhal).
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/ms-seh.cpp Index: clang/test/Analysis/ms-seh.cpp =================================================================== --- /dev/null +++ clang/test/Analysis/ms-seh.cpp @@ -0,0 +1,13 @@ +// 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 + clang_analyzer_warnIfReached(); // no-warning + } __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:
Index: clang/test/Analysis/ms-seh.cpp =================================================================== --- /dev/null +++ clang/test/Analysis/ms-seh.cpp @@ -0,0 +1,13 @@ +// 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 + clang_analyzer_warnIfReached(); // no-warning + } __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:
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits