mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Fix use of uninitialized variable.
Fixes linking bitcode files that use the new style comdats for constructors with ones that don't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215364 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -644,15 +644,19 @@ bool ModuleLinker::computeResultingSelectionKind(StringRef ComdatName,
|
||||
bool ModuleLinker::getComdatResult(const Comdat *SrcC,
|
||||
Comdat::SelectionKind &Result,
|
||||
bool &LinkFromSrc) {
|
||||
Comdat::SelectionKind SSK = SrcC->getSelectionKind();
|
||||
StringRef ComdatName = SrcC->getName();
|
||||
Module::ComdatSymTabType &ComdatSymTab = DstM->getComdatSymbolTable();
|
||||
Module::ComdatSymTabType::iterator DstCI = ComdatSymTab.find(ComdatName);
|
||||
|
||||
if (DstCI == ComdatSymTab.end())
|
||||
if (DstCI == ComdatSymTab.end()) {
|
||||
// Use the comdat if it is only available in one of the modules.
|
||||
LinkFromSrc = true;
|
||||
Result = SSK;
|
||||
return false;
|
||||
}
|
||||
|
||||
const Comdat *DstC = &DstCI->second;
|
||||
Comdat::SelectionKind SSK = SrcC->getSelectionKind();
|
||||
Comdat::SelectionKind DSK = DstC->getSelectionKind();
|
||||
return computeResultingSelectionKind(ComdatName, SSK, DSK, Result,
|
||||
LinkFromSrc);
|
||||
|
Reference in New Issue
Block a user