wasm-tools icon indicating copy to clipboard operation
wasm-tools copied to clipboard

Make sure (unused) sections of bits in RefType are zeroed out

Open imikushin opened this issue 2 years ago • 0 comments

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.

imikushin avatar May 16 '23 20:05 imikushin