Actions
Feature #21796
closedunpack variant that returns the final offset
Feature #21796:
unpack variant that returns the final offset
Status:
Closed
Assignee:
-
Target version:
-
Description
mame (Yusuke Endoh) wrote in #note-4:
It's a shame
unpackdoesn't tell you how many bytes it read. You'd probably want aunpackvariant that returns the final offset too, or a specifier that returns the current offset (likeo?).
mame (Yusuke Endoh) wrote in #note-6:
You could tell how many bytes you read based on the size of the leb128_value returned.
That apparoach is unreliable because LEB128 is redundant. For example, both
"\x03"and"\x83\x00"are valid LEB128 encodings of the value 3.
See the note of the section Values - Integers, in the Wasm spec.
https://webassembly.github.io/spec/core/binary/values.html#integers
Actions