mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
Remove memory corruption bug. string.c_str() was returning a temporary that was
dead before we used it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77304 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
542383d93b
commit
db1e9981b8
@ -409,7 +409,7 @@ void LTOModule::addPotentialUndefinedSymbol(GlobalValue* decl, Mangler &mangler)
|
|||||||
if (isa<GlobalAlias>(decl))
|
if (isa<GlobalAlias>(decl))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const char* name = mangler.getMangledName(decl).c_str();
|
std::string name = mangler.getMangledName(decl);
|
||||||
|
|
||||||
// we already have the symbol
|
// we already have the symbol
|
||||||
if (_undefines.find(name) != _undefines.end())
|
if (_undefines.find(name) != _undefines.end())
|
||||||
@ -417,7 +417,7 @@ void LTOModule::addPotentialUndefinedSymbol(GlobalValue* decl, Mangler &mangler)
|
|||||||
|
|
||||||
NameAndAttributes info;
|
NameAndAttributes info;
|
||||||
// string is owned by _undefines
|
// string is owned by _undefines
|
||||||
info.name = ::strdup(name);
|
info.name = ::strdup(name.c_str());
|
||||||
if (decl->hasExternalWeakLinkage())
|
if (decl->hasExternalWeakLinkage())
|
||||||
info.attributes = LTO_SYMBOL_DEFINITION_WEAKUNDEF;
|
info.attributes = LTO_SYMBOL_DEFINITION_WEAKUNDEF;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user