WebAssembly / reference-types

Proposal for adding basic reference types (anyref)
https://webassembly.github.io/reference-types/
Other
162 stars 40 forks source link

Failure string in core tests #113

Closed q82419 closed 4 years ago

q82419 commented 4 years ago

I found that there are some incompatible failure strings.

  1. out of bounds In tests such as core/table_grow.wast, the failure strings when a trap occurs are out of bounds table access. In tests such as core/memory_grow.wast, the failure strings when a trap occurs are out of bounds memory access. But the failure strings in some files such as core/data.wast, core/elem.wast, core/linking.wast, etc. are only out of bounds. Is that true to fix them as out of bounds table access and out of bounds memory access?

  2. unknowns In old tests, the failure strings are only unknown memory, unknown table, etc. in assert_invalid tests. But in core/table_init.wast, core/memory_init.wast, core/memory_fill.wast, core/memory_copy.wast, and core/ref_func.wast, the index added: unknown memory 0, unknown table 0, unknown element segment 4, etc. Furthermore, in core/memory_init.wast, there are 2 types of strings: unknown data segment and unknown data segment 1. Can it have a general failure string format, contains or without the unknown instance index?

  3. undefined element In tests such as core/call_indirect.wast and core/func_ptrs.wast, the failure string when trap occurs in call_indirect instruction is undefined element. But in core/linking.wast, the string is undefined. Are them the same failure and the string should be fixed to undefined element?

Thanks.

rossberg commented 4 years ago

The semantics of asserts is such that it only requires the string to match the prefix of the actual error message, and this has been used a bit inconsistently across tests. Most implementations don't care about the concrete string anyway, but happy to accept patches if you feel strongly that this should be cleaned up. :)