Skip to content

Conversation

tlively
Copy link
Member

@tlively tlively commented Oct 1, 2025

Validate that the descriptor operand of ref.cast_desc is always a
descriptor reference (or a nullref or unreachable), even if the ref
operand and therefore the ref.cast_desc are unreachable. This removes an
edge case passes might otherwise have to consider where the descriptor
operand is not actually a descriptor. Update GTO to preserve this new
validation invariant.

Also print an unreachable ref.cast_desc instruction when we can
determine its type from a concrete, non-null descriptor operand rather
than bailing out and printing an unreachable block. This allows us to
preserve such IR through text round trips, which can help e.g. test case
reduction.

Validate that the descriptor operand of ref.cast_desc is always a
descriptor reference (or a nullref or unreachable), even if the ref
operand and therefore the ref.cast_desc are unreachable. This removes an
edge case passes might otherwise have to consider where the descriptor
operand is not actually a descriptor. Update GTO to preserve this new
validation invariant.

Also print an unreachable ref.cast_desc instruction when we can
determine its type from a concrete, non-null descriptor operand rather
than bailing out and printing an unreachable block. This allows us to
preserve such IR through text round trips, which can help e.g. test case
reduction.
@tlively tlively requested a review from kripken October 1, 2025 22:50
@tlively
Copy link
Member Author

tlively commented Oct 1, 2025

Going to merge without heavy additional fuzzing because this is on the path to fixing the descriptor type validation rules, which have been causing many fuzzer failures for me.

@tlively tlively merged commit f1614a6 into main Oct 1, 2025
16 checks passed
@tlively tlively deleted the validate-unreachable-cast-desc-descriptor branch October 1, 2025 23:39
tlively added a commit that referenced this pull request Oct 1, 2025
Do not leave unreachable ref.cast_desc instructions with descriptors
arguments that have been optimized to no longer be descriptors. This was
intended to be inluded in #7937.
@tlively
Copy link
Member Author

tlively commented Oct 1, 2025

Ugh, and of course I now notice I forgot to actually commit the GTO fix: #7938.

tlively added a commit that referenced this pull request Oct 2, 2025
Do not leave unreachable ref.cast_desc instructions with descriptors
arguments that have been optimized to no longer be descriptors. This was
intended to be inluded in #7937.
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