r309499 - CodeGenModule.cpp: [PR33810][Modules] Make sure actual memory corruption before random crash with -fmodules.
NAKAMURA Takumi via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 29 21:08:23 PDT 2017
Author: chapuni
Date: Sat Jul 29 21:08:23 2017
New Revision: 309499
URL: http://llvm.org/viewvc/llvm-project?rev=309499&view=rev
Log:
CodeGenModule.cpp: [PR33810][Modules] Make sure actual memory corruption before random crash with -fmodules.
Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=309499&r1=309498&r2=309499&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sat Jul 29 21:08:23 2017
@@ -745,6 +745,8 @@ StringRef CodeGenModule::getMangledName(
// Keep the first result in the case of a mangling collision.
auto Result = Manglings.insert(std::make_pair(Str, GD));
+ assert(&FoundStr == &MangledDeclNames[CanonicalGD] && "FoundStr is invalidated!");
+ assert(FoundStr.empty() && "FoundStr is not empty!");
return FoundStr = Result.first->first();
}
More information about the cfe-commits
mailing list