]> granicus.if.org Git - clang/commitdiff
CodeGenModule.cpp: [PR33810][Modules] Make sure actual memory corruption before rando...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Sun, 30 Jul 2017 04:08:23 +0000 (04:08 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Sun, 30 Jul 2017 04:08:23 +0000 (04:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309499 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index d616486f17d41df89bfebfa7fe9e39515d7af10a..63d5ff3bee24b2e6c56711111ef195704a14226c 100644 (file)
@@ -745,6 +745,8 @@ StringRef CodeGenModule::getMangledName(GlobalDecl GD) {
 
   // 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();
 }