[PATCH] D43659: [analyzer] Don't crash when dynamic type of a concrete region is hard-set with placement new.

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 22 17:06:08 PST 2018


george.karpenkov accepted this revision.
george.karpenkov added a comment.
This revision is now accepted and ready to land.

LGTM, though in general I still think we should do something on soft-failure-modes in order to aid future debugging...

Is the failure mode in this case always a UB? In this case, could we emit a warning? If not from CallEvent, then from where?



================
Comment at: lib/StaticAnalyzer/Core/CallEvent.cpp:593
+        // Fall back to a generic pointer cast for this-value.
+        const CXXMethodDecl *StaticMD = cast<CXXMethodDecl>(getDecl());
+        const CXXRecordDecl *StaticClass = StaticMD->getParent();
----------------
nit: auto?


Repository:
  rC Clang

https://reviews.llvm.org/D43659





More information about the cfe-commits mailing list