summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2019-05-09 23:17:41 +0000
committerLang Hames <lhames@gmail.com>2019-05-09 23:17:41 +0000
commit112967833e4f8f4943beb71dfe5fdfe17788cadd (patch)
tree28f36040687b86423e6050d6f56874454e58926c /llvm/lib/ExecutionEngine
parent76ea748d2d24144c1a50c0ce5c5b41dbcab0ac15 (diff)
downloadbcm5719-llvm-112967833e4f8f4943beb71dfe5fdfe17788cadd.tar.gz
bcm5719-llvm-112967833e4f8f4943beb71dfe5fdfe17788cadd.zip
[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
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp4
1 files changed, 2 insertions, 2 deletions
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.
OpenPOWER on IntegriCloud