[JITLink] Fixed a signedness bug when processing X86_64_RELOC_SUBTRACTOR.
authorLang Hames <lhames@gmail.com>
Thu, 9 May 2019 23:17:41 +0000 (23:17 +0000)
committerLang Hames <lhames@gmail.com>
Thu, 9 May 2019 23:17:41 +0000 (23:17 +0000)
commit112967833e4f8f4943beb71dfe5fdfe17788cadd
tree28f36040687b86423e6050d6f56874454e58926c
parent76ea748d2d24144c1a50c0ce5c5b41dbcab0ac15
[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
llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s