diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2017-07-30 04:08:23 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2017-07-30 04:08:23 +0000 |
commit | e9db9dbd2d719355fecb128e71309d2a4a9fcd99 (patch) | |
tree | de6d3556c55082cd5d7eb4256caa175ed89b45be /lib/CodeGen/CodeGenModule.cpp | |
parent | ea7f5dc7ac34d996ce4f3ffeeeeea6ffdfa11de9 (diff) |
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
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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(); } |