================
@@ -1281,20 +1281,20 @@ static void showBRDiagnostics(llvm::raw_svector_ostream
&OS, StoreInfo SI) {
// We don't need to check here, all these conditions were
// checked by StoreSiteFinder, when it figured out that it is
// initialization.
- const auto *DS =
- cast<DeclStmt>(SI.StoreSite->getLocationAs<PostStmt>()->getStmt());
-
- if (SI.Value.isUndef()) {
- if (isa<VarRegion>(SI.Dest)) {
- const auto *VD = cast<VarDecl>(DS->getSingleDecl());
-
- if (VD->getInit()) {
- OS << (HasPrefix ? "initialized" : "Initializing")
- << " to a garbage value";
- } else {
- OS << (HasPrefix ? "declared" : "Declaring")
- << " without an initial value";
- }
+ const auto *VR = dyn_cast<VarRegion>(SI.Dest);
+ if (VR) {
+ const auto *VD = VR->getDecl();
----------------
NagyDonat wrote:
> Additionally, the old code's getSingleDecl() would assert/crash on multi-decl
> statements.
:astonished:
Thanks for checking and fixing this! :smile:
https://github.com/llvm/llvm-project/pull/198345
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits