Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Conversation

@Honry
Copy link
Contributor

@Honry Honry commented Jan 20, 2020

  • Fix mistake tests in simd_load.wast
  • Missing lane index should be malformed
  • Test more values of lane index

Fix #181

- Fix mistake tests in simd_load.wast
- Missing lane index should be malformed
- Test more values of lane index
@Honry
Copy link
Contributor Author

Honry commented Jan 20, 2020

@alexcrichton, @abrown, @tlively, PTAL, thanks!


;; Malformed lane index value

(assert_malformed (module (func (result i32) (i8x16.extract_lane_s -1 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)))) "malformed lane index")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be misinterpreting the intention, but I was under the impression that assert_malformed should largely always be used with (module quote "...") because in theory this sort of parse error doesn't work in that when we try to parse the assert_malformed directive it will fail since the contents are designed to not parse.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WAVM is more permissive here than it probably should be: an error in an unquoted module that the parser can recover from without skipping out of the assert_malformed will be treated the same as if the module was quoted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Searching around https://github.com/webassembly/testsuite it looks like all assert_malformed directives are either coupled with (module quote or (module binary currently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexcrichton @Honry WAVM/WAVM@165863c makes it an error to use anything other than a quoted or binary module in assert_malformed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! That looks great to me, thanks! 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @AndrewScheidecker, @alexcrichton, I will make a copy of the fix from WAVM to this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@abrown
Copy link
Contributor

abrown commented Jan 21, 2020

@Honry, looks good to me. @alexcrichton, should we revert bytecodealliance/wat#45 then?

@alexcrichton
Copy link
Contributor

@abrown yeah I think it's safe to revert that, and I should also mention that apart from assert_malformed and module quote ..., also looks great to me. Thanks @Honry!

@tlively tlively merged commit 0473234 into WebAssembly:master Jan 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is (v128.const) supposed to parse in the text format?

5 participants