serenity icon indicating copy to clipboard operation
serenity copied to clipboard

LibWasm: Parse i33's

Open dzfrias opened this issue 1 year ago • 1 comments

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.

dzfrias avatar May 27 '24 14:05 dzfrias

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).

dzfrias avatar May 29 '24 17:05 dzfrias