From c9220039218e2c0ea4a2774a43bbc9088cc1b983 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 30 Jul 2017 04:08:23 +0000 Subject: CodeGenModule.cpp: [PR33810][Modules] Make sure actual memory corruption before random crash with -fmodules. llvm-svn: 309499 --- clang/lib/CodeGen/CodeGenModule.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d616486f17d..63d5ff3bee2 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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(); } -- cgit v1.2.3