Repository navigation
[test] Add grammar rejection cases - #2354
Merged
Merged
Conversation
A type use has at most one (type x) clause, and that clause holds exactly one type index. Add cases with two clauses, two indices, an extra field, and no index.
A local with an id declares exactly one value type. Add cases with no type and with two ids.
The else and end keywords belong to block instructions, and an if has at most one else. Add cases with a second else, and with an else or an end that has no open block, in plain and folded form.
An export names exactly one index, and br_table needs at least one label. Add a case for each, in plain and folded form for br_table.
Every elem segment form needs an element list, which starts with a reference type or func. Add cases for the passive, declarative and active forms without one.
The ids of elem segments and data segments must be distinct, as for other index spaces.
The lane index of v128.storeN_lane comes after the memarg. Add cases that put it before the memarg, with and without a memory index. The cases come from simd/meta/simd_store_lane.py.
ibmibmibm
marked this pull request as ready for review
November 25, 2026 23:25
rossberg
approved these changes
Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds malformed cases for grammar rules that no test checks: bad
localdeclarations, a bad type use, an export with two indices,br_tablewith no label, a stray or secondelse, a strayend, an elem segment with no list, duplicate elem and data ids, and a store lane index before the memarg, with and without a memory index. One commit per rule.The store lane cases are added through
simd/meta/simd_store_lane.py.