serenity
serenity copied to clipboard
LibWasm: Parse i33's
Unfortunately, signed 33-bit integers are part of the WebAssembly spec, and are needed when parsing blocktypes. Currently, we don't have anything to handle this case.
Should we make a special i33 type (to integrate with Stream::read_value? Or is it okay just to make a special one-off function that'll parse an i33 from the stream? We don't technically need a new datatype, since we can represent it as an i64 that's been parsed in a weird way. We can't really fit it in the LEB128 type, sadly.
Even though we have #24464, I think we should keep this issue open until full spec compliance is reached (see the PR for more details).