mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
object/COFF: Properly initalize uses of DataRefImpl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c8a55a660e
commit
783d88793a
@ -284,6 +284,7 @@ error_code COFFObjectFile::getSymbolSection(DataRefImpl Symb,
|
|||||||
const coff_section *sec;
|
const coff_section *sec;
|
||||||
if (error_code ec = getSection(symb->SectionNumber, sec)) return ec;
|
if (error_code ec = getSection(symb->SectionNumber, sec)) return ec;
|
||||||
DataRefImpl Sec;
|
DataRefImpl Sec;
|
||||||
|
std::memset(&Sec, 0, sizeof(Sec));
|
||||||
Sec.p = reinterpret_cast<uintptr_t>(sec);
|
Sec.p = reinterpret_cast<uintptr_t>(sec);
|
||||||
Result = section_iterator(SectionRef(Sec, this));
|
Result = section_iterator(SectionRef(Sec, this));
|
||||||
}
|
}
|
||||||
@ -618,6 +619,7 @@ error_code COFFObjectFile::getRelocationSymbol(DataRefImpl Rel,
|
|||||||
SymbolRef &Res) const {
|
SymbolRef &Res) const {
|
||||||
const coff_relocation* R = toRel(Rel);
|
const coff_relocation* R = toRel(Rel);
|
||||||
DataRefImpl Symb;
|
DataRefImpl Symb;
|
||||||
|
std::memset(&Symb, 0, sizeof(Symb));
|
||||||
Symb.p = reinterpret_cast<uintptr_t>(SymbolTable + R->SymbolTableIndex);
|
Symb.p = reinterpret_cast<uintptr_t>(SymbolTable + R->SymbolTableIndex);
|
||||||
Res = SymbolRef(Symb, this);
|
Res = SymbolRef(Symb, this);
|
||||||
return object_error::success;
|
return object_error::success;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user