Skip to content

Commit

Permalink
[test] Don't require the element index in "uninitialized element" tra…
Browse files Browse the repository at this point in the history
…p strings. (#1076)

One test in elem.wast expects the trap message "uninitialized element 7",
which requires wasm runtimes to be able to print the element index. This
is obviously nice for humans, but can be inconvenient to implement in wasm
implementations which use signals to implement traps, as it requires special
code to preserve the element index.

Other tests eg. in imports.wast don't include the number in the expected
message.

It seems better to allow implementations to decide for themselves
whether to print the index number, rather than having it be an outright
requirement of the spec test.
  • Loading branch information
sunfishcode authored and rossberg committed Sep 26, 2019
1 parent c94f0c1 commit 92c117d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/core/elem.wast
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@

(register "module1" $module1)

(assert_trap (invoke $module1 "call-7") "uninitialized element 7")
(assert_trap (invoke $module1 "call-7") "uninitialized element")
(assert_return (invoke $module1 "call-8") (i32.const 65))
(assert_return (invoke $module1 "call-9") (i32.const 66))

Expand Down

0 comments on commit 92c117d

Please sign in to comment.