================
@@ -71,7 +71,8 @@ void DanglingPtrDeref::reportUseAfterScope(const MemRegion 
*Region,
                                            CheckerContext &C) const {
   auto BR = std::make_unique<PathSensitiveBugReport>(
       BugMsg,
-      (llvm::Twine("Use of ") + lifetime_modeling::getRegionName(Region) +
+      (llvm::Twine("Use of ") +
+       Region->getDescriptiveName(/*UseQuotes=*/true, /*AllowFallback=*/true) +
        " after its lifetime ended."),
       N);
----------------
benedekaibas wrote:

It depends on which fallback case will get executed in 
https://github.com/llvm/llvm-project/blob/8723e3139f7bfb046124938305ef3d05c4ad726f/clang/lib/StaticAnalyzer/Core/MemRegion.cpp#L725

If that is what you mean, then yes based on which fallback path gets executed 
the message would not be deterministically "the region". This is how I 
understand it.

Based on https://github.com/llvm/llvm-project/pull/213991/changes#r3720497744 
to still preserve our own fallback which would be "the region".

https://github.com/llvm/llvm-project/pull/214245
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to