Fix assertion in br_on_cast finalization#8476
Merged
Conversation
kripken
reviewed
Mar 17, 2026
test/lit/validation/shared-cast.wast
Outdated
| (type $unshared (struct)) | ||
|
|
||
| (func $shared-to-unshared (param $s (ref $shared)) | ||
| ;; CHECK: [wasm-validator error in function shared-to-unshared] unexpected false: unreachable instruction must have unreachable child |
Member
There was a problem hiding this comment.
These messages are not clear as to the actual problem. Can the validator at least add "this can happen if [.. common case ..]"?
If the br_on_cast is invalid because its input and output types are unrelated, the GLB used as the new cast type will be unreachable. This caused an assertion that the GLB was a reference to fail. Bail out early in this case and leave the unreachable cast type for the validator to find.
fbde76b to
7e8497f
Compare
kripken
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the br_on_cast is invalid because its input and output types are unrelated, the GLB used as the new cast type will be unreachable. This caused an assertion that the GLB was a reference to fail. Bail out early in this case and leave the unreachable cast type for the validator to find.