Skip to content

Clarification on LEB128 Error Interpretation in Binary Function Type Test #1853

@chobie

Description

@chobie

Hello. I am currently creating an interpreter for WebAssembly 2.0 and have a question about the specification of LEB128.

In the binary-leb128 tests, there is the following test case. From my understanding, it seems to be an error for any fixed byte value other than 0x60. However, the test case seems to interpret it as a u8 LEB128 error.

https://github.com/WebAssembly/spec/blob/main/test/core/binary-leb128.wast#L1078

"\e0\7f"                  ;; Malformed functype, -0x20 in signed LEB128 encoding

Looking at the draft specification:
https://webassembly.github.io/spec/core/binary/types.html#binary-functype

Function types are encoded by the byte 0x60

Given this, should this test case be interpreted as an error for values other than 0x60, or should it be treated as a u8 LEB128 error? Which interpretation is more appropriate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions