wasm-tools
wasm-tools copied to clipboard
Make sure (unused) sections of bits in RefType are zeroed out
RefType is a a struct that plays a role of a "bit-packed enum". When a RefType value represents a reference to a top- or bottom-level heap type (introduced by the GC spec, e.g. any, eq, i31, none, etc.), it can contain a section of "(unused)" bits.
When creating an instance of RefType (from raw bytes), we need to make sure, that the unused section is zeroed out.