<div dir="ltr"><div>I've attached the patch.</div><div><br></div><div>The issue is that ubsan spotted a case where we extract 21 bits from a negative signed addend value in order to encode it into binary representation of reloc.</div><div><br></div><div>While behavior is harmless in this case, technically it does fall under undefined behavior. The patch extracts relevant bits into an unsigned variable first and then uses that unsigned value to shift bits around.</div><div><br></div><div>--Artem</div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 8, 2015 at 1:46 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@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">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" target="_blank">http://llvm.org/docs/Phabricator.html</a></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote"><br></div></div></div></div></blockquote></div>-- <br><div class="gmail_signature"><div dir="ltr">--Artem Belevich</div></div>
</div></div>