[PATCH] D102280: [analyzer] Engine: fix crash with SEH __leave keyword

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 12 00:43:28 PDT 2021


steakhal added reviewers: NoQ, vsavchenko, steakhal.
steakhal added a comment.

Please, add these reviewers for your upcoming [analyzer] patches.
Inline a couple of nits.
Nice to see some fixes for visual c++ stuff.



================
Comment at: clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:352
 
+      case Stmt::SEHLeaveStmtClass:
       case Stmt::ContinueStmtClass:
----------------
You should probably extend the `ExprEngine.cpp:1312` in a similar fashion.


================
Comment at: clang/test/Analysis/misc-ms-leave.cpp:12
+  __try {
+    __leave;
+  } __except (filter()) {
----------------
If it crashed previously at this statement, please put there a `// no-crash` comment.


================
Comment at: clang/test/Analysis/misc-ms-leave.cpp:16
+  int *p = 0;
+  int x = *p; // expected-warning {{Dereference of null pointer (loaded from variable 'p')}}
+}
----------------
I guess you could simply use the `clang_analyzer_warnIfReached()` here. 
https://clang.llvm.org/docs/analyzer/developer-docs/DebugChecks.html


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102280/new/

https://reviews.llvm.org/D102280



More information about the cfe-commits mailing list