This is an archive of the discontinued LLVM Phabricator instance.

[C2x][ObjC] Do not crash when trying to encode a _BitInt type
ClosedPublic

Authored by aaron.ballman on Jan 27 2022, 12:21 PM.

Details

Summary

Using a _BitInt (or _ExtInt) type as a block parameter or block return type hits an "unreachable" when trying to determine the encoding for the block. Instead of crashing, this patch handles it like some of the other types for which we don't yet have an encoding. The test case verifies we no longer crash, but does not verify that we provide any particular encoding (it can be updated once someone more familiar with ObjC steps in to define the encoding).

Fixes PR50503.

Diff Detail

Event Timeline

aaron.ballman requested review of this revision.Jan 27 2022, 12:21 PM
aaron.ballman created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2022, 12:21 PM

These seems right to me, but I think @rjmccall knows more about ObjC to make sure nothing silly is happening here.

I don't think you really need the FIXME when we don't have it for all the other types that we don't have encodings for.

But overall this seems fine, yeah.

aaron.ballman accepted this revision.Jan 28 2022, 5:39 AM

Thanks for the reviews! I've landed in b6d9ca14c20f6f982a9fee4bebccf4761400f6aa (with the FIXME removed). Self-accepting on the two LGs so that I can close the review.

This revision is now accepted and ready to land.Jan 28 2022, 5:39 AM
aaron.ballman closed this revision.Jan 28 2022, 5:39 AM