It was using a temporary StringRef after its underlying storage was freed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261944
91177308-0d34-0410-b5e6-
96231b3b80d8
StringRef Desc = StringRef();
auto *IvarRegion = dyn_cast_or_null<ObjCIvarRegion>(PriorSubRegion);
+ std::string Buf;
+ llvm::raw_string_ostream OS(Buf);
if (IvarRegion) {
- std::string Buf;
- llvm::raw_string_ostream OS(Buf);
OS << "use of instance variable '" << *IvarRegion->getDecl() <<
"' after the instance has been freed with call to [super dealloc]";
Desc = OS.str();