Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Strings] Emit unreachable when a string instruction cannot be emitted properly #6415

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented Mar 21, 2024

@kripken kripken requested a review from tlively March 21, 2024 00:16
Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly worth doing this in the printer as well for consistency. WDYT?

@kripken
Copy link
Member Author

kripken commented Mar 21, 2024

Hmm, I think it might be best not to. We print an unreachable for text when we have to, like struct.get of a bottom type, because we have no way to print the immediate in a valid way. But here we can emit the instruction, which means it will round-trip, and more closely reflects the IR, which seems useful?

@tlively
Copy link
Member

tlively commented Mar 21, 2024

I guess so, but we'd have to fix it anyway if not for the spec bug that there is no annotation. I'm half tempted to say we should just add the annotation and pretend the spec bug has already been fixed, but that sounds like more trouble than it's worth.

Anyway, I don't feel too strongly about it.

@kripken
Copy link
Member Author

kripken commented Mar 21, 2024

I see. Yeah, if the spec gets changed we'd need to do this. Anyhow, for now this is just more convenient (both less work and more roundtripping).

@kripken kripken merged commit afcb387 into WebAssembly:main Mar 21, 2024
14 checks passed
@kripken kripken deleted the string.unreach branch March 21, 2024 17:14
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants