webassemblyjs icon indicating copy to clipboard operation
webassemblyjs copied to clipboard

Reactivate block test in wasm-parser

Open xtuc opened this issue 7 years ago • 5 comments

Here's the test: https://github.com/xtuc/webassemblyjs/blob/fed152017fd5d19c09c8c53e3369d849e7c538f2/packages/wasm-parser/test/fixtures/block/with-label/actual.wat-failure#L3

It has been disabled in #276

xtuc avatar May 03 '18 13:05 xtuc

Hmm ... can blocks have names? I can't find the reference right now, but I have a feeling that this was a feature that was removed before v1 of WebAssembly. Instructions like br, br_if, ... all break to a specific depth rather than a label.

Also, running wat2wasm --debug-names with the following:

(module
  (func
    (block $test)
  )
)

Does not include the string 'test' in the custom name section.

ColinEberhardt avatar May 05 '18 16:05 ColinEberhardt

Although a label is mentioned in the spec:

image

ColinEberhardt avatar May 05 '18 16:05 ColinEberhardt

Despite the spec indicating that branch instructions can use labels or indices, I can't find any examples in the test suite (https://github.com/WebAssembly/testsuite) that use labels.

ColinEberhardt avatar May 05 '18 16:05 ColinEberhardt

Ok, thanks for the clarification.

The name is probably available in WAST as syntactic sugar but not actual semantics.

So I guess we should just remove this test?

xtuc avatar May 05 '18 17:05 xtuc

Yes, I agree, this should be removed.

ColinEberhardt avatar May 05 '18 21:05 ColinEberhardt