This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Resolve PR33978.
ClosedPublic

Authored by sdardis on Aug 2 2017, 12:56 PM.

Details

Summary

rL306209 taught SelectionDAG how to add the dereferenceable flag when
expanding memcpy and memmove. The fix however contained a nit where
the offset + size was constructed as an APInt of PointerSize rather
than PointerSizeInBits.

This lead to isDereferenceableAndAlignedPointer() get truncated values or
values which would be sign extended within that function leading to
incorrect results.

Thanks to Alex Crichton for reporting the issue!

This resolves PR33978.

Event Timeline

sdardis created this revision.Aug 2 2017, 12:56 PM
inouehrs accepted this revision.Aug 3 2017, 12:21 AM

Thank you for catching this. LGTM.

This revision is now accepted and ready to land.Aug 3 2017, 12:21 AM
This revision was automatically updated to reflect the committed changes.