From: NAKAMURA Takumi Date: Sun, 30 Jul 2017 04:08:23 +0000 (+0000) Subject: CodeGenModule.cpp: [PR33810][Modules] Make sure actual memory corruption before rando... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e9db9dbd2d719355fecb128e71309d2a4a9fcd99;p=clang CodeGenModule.cpp: [PR33810][Modules] Make sure actual memory corruption before random crash with -fmodules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309499 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index d616486f17..63d5ff3bee 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -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(); }