<div dir="ltr">FYI, could you attach the patch file rather than including it inline, or post it using Phabricator[1]?<div><br></div><div>[1]: <a href="http://llvm.org/docs/Phabricator.html">http://llvm.org/docs/Phabricator.html</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 8, 2015 at 1:38 PM, Artem Belevich <span dir="ltr"><<a href="mailto:tra@google.com" target="_blank">tra@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ping!<br><br>BTW, the issue the patch fixes is a ubsan warning in the following test case:<br><br>test/ExecutionEngine/RuntimeDyld/AArch64/MachO_ARM64_relocations.s /tmp/foo.o<br>third_party/llvm/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h:186:47: runtime error: left shift of negative value -57344<br><br>--Artem<div><div class="h5"><br><br>On Tue, Dec 23, 2014 at 1:02 PM, Artem Belevich <<a href="mailto:tra@google.com" target="_blank">tra@google.com</a>> wrote:<br>><br>> ---<br>>  lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h | 5 +++--<br>>  1 file changed, 3 insertions(+), 2 deletions(-)<br>><br>> diff --git a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h<br>> index 274c552..8fc58ee 100644<br>> --- a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h<br>> +++ b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h<br>> @@ -183,8 +183,9 @@ public:<br>>        assert(isInt<33>(Addend) && "Invalid page reloc value.");<br>><br>>        // Encode the addend into the instruction.<br>> -      uint32_t ImmLoValue = (uint32_t)(Addend << 17) & 0x60000000;<br>> -      uint32_t ImmHiValue = (uint32_t)(Addend >> 9) & 0x00FFFFE0;<br>> +      uint64_t AddressBits = Addend & 0x1FFFFF000;<br>> +      uint32_t ImmLoValue = (uint32_t)(AddressBits << 17) & 0x60000000;<br>> +      uint32_t ImmHiValue = (uint32_t)(AddressBits >> 9) & 0x00FFFFE0;<br>>        *p = (*p & 0x9F00001F) | ImmHiValue | ImmLoValue;<br>>        break;<br>>      }<br>> --<br>> 2.2.0.rc0.207.ga3a616c<br>><br><br><br><br></div></div>--<br>--Artem Belevich<br><div class="gmail_extra">
</div></div>
</blockquote></div><br></div>