mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 07:17:36 +00:00
Fix segfault in AArch64 backend with -g and -mbig-endian
Fix a null pointer dereference when trying to swap the endianness of fixups in the .eh_frame section in the AArch64 backend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218311 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -535,8 +535,8 @@ void ELFAArch64AsmBackend::applyFixup(const MCFixup &Fixup, char *Data,
|
||||
// store fixups in .eh_frame section in big endian order
|
||||
if (!IsLittleEndian && Fixup.getKind() == FK_Data_4) {
|
||||
const MCSection *Sec = Fixup.getValue()->FindAssociatedSection();
|
||||
const MCSectionELF *SecELF = static_cast<const MCSectionELF *>(Sec);
|
||||
if (SecELF->getSectionName() == ".eh_frame")
|
||||
const MCSectionELF *SecELF = dyn_cast_or_null<const MCSectionELF>(Sec);
|
||||
if (SecELF && SecELF->getSectionName() == ".eh_frame")
|
||||
Value = ByteSwap_32(unsigned(Value));
|
||||
}
|
||||
AArch64AsmBackend::applyFixup (Fixup, Data, DataSize, Value, IsPCRel);
|
||||
|
||||
Reference in New Issue
Block a user