[clang] [analyzer] Improve bug report hashing, merge similar reports (PR #98621)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 13:03:12 PDT 2024


================
@@ -373,14 +373,14 @@ static std::optional<int64_t> getConcreteValue(std::optional<NonLoc> SV) {
 }
 
 static Messages getPrecedesMsgs(const SubRegion *Region, NonLoc Offset) {
-  std::string RegName = getRegionName(Region);
-  SmallString<128> Buf;
-  llvm::raw_svector_ostream Out(Buf);
-  Out << "Access of " << RegName << " at negative byte offset";
-  if (auto ConcreteIdx = Offset.getAs<nonloc::ConcreteInt>())
-    Out << ' ' << ConcreteIdx->getValue();
----------------
NagyDonat wrote:

This `raw_svector_ostream` solution is very clunky, so I replaced it with a less ugly alternative when I re-added the code that prints the offset.

https://github.com/llvm/llvm-project/pull/98621


More information about the cfe-commits mailing list