mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-18 09:09:12 +00:00
Add an assert to check that the Addend fits the file format.
llvm-svn: 136868
This commit is contained in:
parent
a910136fe2
commit
77b83123f6
@ -462,6 +462,12 @@ void ELFObjectWriter::RecordRelocation(const MCAssembler &Asm,
|
||||
|
||||
if (!hasRelocationAddend())
|
||||
Addend = 0;
|
||||
|
||||
if (is64Bit())
|
||||
assert(isInt<64>(Addend));
|
||||
else
|
||||
assert(isInt<32>(Addend));
|
||||
|
||||
ELFRelocationEntry ERE(RelocOffset, Index, Type, RelocSymbol, Addend);
|
||||
Relocations[Fragment->getParent()].push_back(ERE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user