This is an archive of the discontinued LLVM Phabricator instance.

[RelLookupTableConverter] Bail on invalid pointer size (x32)
ClosedPublic

Authored by nikic on Aug 8 2022, 7:41 AM.

Details

Summary

The RelLookupTableConverter pass currently only supports 64-bit pointers. This is currently enforced using an isArch64Bit() check on the target triple. However, we consider x32 to be a 64-bit target, even though the pointers are 32-bit. (And independently of that specific example, there may be address spaces with different pointer sizes.)

As such, add an additional guard for the size of the pointers that are actually part of the lookup table.

Diff Detail

Event Timeline

nikic created this revision.Aug 8 2022, 7:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 7:41 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
nikic requested review of this revision.Aug 8 2022, 7:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 7:41 AM
leonardchan accepted this revision.Aug 8 2022, 11:43 AM

LGTM pending any comments @gulfem may have

This revision is now accepted and ready to land.Aug 8 2022, 11:43 AM
gulfem accepted this revision.Aug 8 2022, 4:17 PM

Thanks @nikic, LGTM.

This revision was landed with ongoing or failed builds.Aug 9 2022, 12:37 AM
This revision was automatically updated to reflect the committed changes.