Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Clarifying ref.is_null matching validation #547

Answered by rossberg
CharlieTap asked this question in Q&A

You must be logged in to vote

The type bot is a valid heap type — and (ref null bot) hence a valid reference type — so the rule would allow picking it. However, that choice usually isn't useful as an input type, since there are no actual values of that type and hence this would normally not allow successfully typing an instruction sequence in which this instruction occurs. You need something that is a supertype of the actual operand type, not a subtype.

In the usual algorithmic implementation of validation, you always know what's on the operand stack, so you just take that type directly. See the spec's Appendix for an implementation sketch.

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@CharlieTap

Answer selected by CharlieTap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants