-
Notifications
You must be signed in to change notification settings - Fork 503
[test] Add tests for data segment with memidx 1 #1249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[test] Add tests for data segment with memidx 1 #1249
Conversation
test/core/data.wast
Outdated
| "\01\00" ;; data segment 0 for memory 1 with malformed index expr | ||
| ) | ||
| "unexpected end of section or function" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: newline missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to replace this test with an "assert_invalid" one. It detect the same bug in WABT, but contains single error.
20a3a26 to
d1ee577
Compare
test/core/data.wast
Outdated
| ;; "constant expression required" | ||
| ;; ) | ||
|
|
||
| ;; data segment with memory index 1 (only memory 0 available) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's ;; Data without memory section above, maybe better to move these over there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved.
test/core/data.wast
Outdated
| ;; "constant expression required" | ||
| ;; ) | ||
|
|
||
| ;; data segment with memory index 1 (only memory 0 available) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness I would also add a test with imported memory defined, and data segment with memory index 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
d1ee577 to
f375d45
Compare
|
As WABT is fixed already, can we merge this PR here too? |
|
Merged. Btw, please don't force-push to PR branches, because that breaks the review mechanics. |
* [spec] automate instruction index rebuild (WebAssembly#1259) * [test] Add test for malformed functype (WebAssembly#1254) * [test] Correct tests for missing elements (WebAssembly#1251) Remove the code section in tests for malformed element section. Otherwise the code section id (0x0a) is taken as an element's table index what is a validation error. This is similar to the previously reported issue: WebAssembly#1170. * [test] Add tests for data segment with memidx 1 (WebAssembly#1249) * [test] Correct i32.store alignment in a LEB128 test (WebAssembly#1261) In the binary-leb128.wast, change the alignment of an i32.store instruction from 3 (invalid) to 2 (the intention suggested by the comment). Co-authored-by: Andreas Rossberg <rossberg@dfinity.org> Co-authored-by: Paweł Bylica <chfast@gmail.com>
Related to the bug in WABT: WebAssembly/wabt#1546,
found by Fizzy fuzzing.