summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-07-28 06:53:50 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-07-28 06:53:50 +0000
commit1b329eb2bf75d9fe34a29452a36261c0323b6fa3 (patch)
tree5ff86ec9f1d5980868b564372afb855c44b07316 /llvm/tools
parent8945266f3d024d8b494c7751175519a723205e67 (diff)
downloadbcm5719-llvm-1b329eb2bf75d9fe34a29452a36261c0323b6fa3.tar.gz
bcm5719-llvm-1b329eb2bf75d9fe34a29452a36261c0323b6fa3.zip
Remove memory corruption bug. string.c_str() was returning a temporary that was
dead before we used it. llvm-svn: 77304
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/lto/LTOModule.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/lto/LTOModule.cpp b/llvm/tools/lto/LTOModule.cpp
index cbccfbb9b69..4a2c5ad1dc3 100644
--- a/llvm/tools/lto/LTOModule.cpp
+++ b/llvm/tools/lto/LTOModule.cpp
@@ -409,7 +409,7 @@ void LTOModule::addPotentialUndefinedSymbol(GlobalValue* decl, Mangler &mangler)
if (isa<GlobalAlias>(decl))
return;
- const char* name = mangler.getMangledName(decl).c_str();
+ std::string name = mangler.getMangledName(decl);
// we already have the symbol
if (_undefines.find(name) != _undefines.end())
@@ -417,7 +417,7 @@ void LTOModule::addPotentialUndefinedSymbol(GlobalValue* decl, Mangler &mangler)
NameAndAttributes info;
// string is owned by _undefines
- info.name = ::strdup(name);
+ info.name = ::strdup(name.c_str());
if (decl->hasExternalWeakLinkage())
info.attributes = LTO_SYMBOL_DEFINITION_WEAKUNDEF;
else
OpenPOWER on IntegriCloud