Skip to content
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

Simplify $blocktype function #98

Merged
merged 2 commits into from
Jun 3, 2024
Merged

Simplify $blocktype function #98

merged 2 commits into from
Jun 3, 2024

Conversation

rossberg
Copy link
Collaborator

@rossberg rossberg commented Jun 1, 2024

I would like to make the below simplification to the definition of the $blocktype function. However, the interpreter complaints with the following error:

8-reduction.watsup:69.9-69.44: interpreter error: BLOCK: on expr `IterE (VarE (t_2), [t_2], ^n)` invalid assignment: ?() is not an iterable value (interpreting LetI (InfixE (IterE (VarE (t_1), [t_1], ^m), ->, IterE (VarE (t_2), [t_2], ^n)), CallE (blocktype_, [ VarE (bt) ])))

@f52985, @ShinWonho, could one of you please have a look?

@rossberg rossberg requested a review from f52985 June 1, 2024 16:13
@ShinWonho
Copy link

ShinWonho commented Jun 3, 2024

rule Step_read/block:
  z; val^k (BLOCK bt instr*)  ~>  (LABEL_ n `{eps} val^k instr*)
  -- if $blocktype(z, bt) = t_1^k -> t_2^n

In the premise above, an optional value (result type of $blocktype) is assigned to an iter expression with list iter type (t_2^n).
We missed this case, so I have generalized the assigning logic to handle such cases.

@rossberg
Copy link
Collaborator Author

rossberg commented Jun 3, 2024

Excellent, thanks!

@rossberg rossberg merged commit bb0435c into main Jun 3, 2024
5 checks passed
@rossberg rossberg deleted the blocktype-opt branch June 3, 2024 08:13
rossberg pushed a commit that referenced this pull request Nov 7, 2024
- Removed unnecessary/mismatching lookup of table/memory type in execution prose
- Added missing result type lookup in formal rule for table.size and memory.size
- Fixed computation of -1 result value for table.grow and table.size to work for i64
- Some fixes around specification of text format for inline elements/data shorthand
- Fixed matching rules for tabletype/memtype to enforce same address type

Split out from WebAssembly#1839
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants