From 112967833e4f8f4943beb71dfe5fdfe17788cadd Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 9 May 2019 23:17:41 +0000 Subject: [JITLink] Fixed a signedness bug when processing X86_64_RELOC_SUBTRACTOR. Subtractor relocation addends are signed, so we need to read them via signed int pointers. Accidentally treating 32-bit addends as unsigned leads to out-of-range errors when we try to add very large (>INT32_MAX) bogus addends. llvm-svn: 360392 --- llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/ExecutionEngine') diff --git a/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp b/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp index 2f0eaf206e9..7b4ddc3019a 100644 --- a/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp @@ -157,9 +157,9 @@ private: // Read the current fixup value. uint64_t FixupValue = 0; if (SubRI.r_length == 3) - FixupValue = *(const ulittle64_t *)FixupContent; + FixupValue = *(const little64_t *)FixupContent; else - FixupValue = *(const ulittle32_t *)FixupContent; + FixupValue = *(const little32_t *)FixupContent; // Find 'ToAtom' using symbol number or address, depending on whether the // paired UNSIGNED relocation is extern. -- cgit v1.2.3