Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Fixes the typing rule of CAUGHTadm #244

Merged
merged 4 commits into from
Feb 15, 2023

Conversation

ioannad
Copy link
Collaborator

@ioannad ioannad commented Nov 25, 2022

Addresses review comment on merged #229:
#229 (comment)

Fixes the typing rule of CAUGHTadm as suggested in:
WebAssembly#229 (comment)
@ioannad
Copy link
Collaborator Author

ioannad commented Nov 25, 2022

I just realised there are some more comments on this in open PR #241, which I will address in this PR (tomorrow). I will make all changes to the typing of CAUGHTadm here, because they don't fit in #241.

ioannad added a commit to ioannad/exception-handling that referenced this pull request Nov 26, 2022
Changes to this rule are now done in PR WebAssembly#244
Copy link
Member

@rossberg rossberg left a comment

Choose a reason for hiding this comment

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

LGTM modulo suggestions.

Comment on lines 683 to 685
* Let :math:`C'` be the same :ref:`context <context>` as :math:`C`, but with the first label popped from the |CLABELS| vector.

* Let :math:`C''` be the same :ref:`context <context>` as :math:`C`, but with the label :math:`[t^\ast]` prepended to the |CLABELS| vector.
* Let :math:`C''` be the same :ref:`context <context>` as :math:`C'`, but with the label type :math:`(\LCATCH~[t^\ast])` prepended to the |CLABELS| vector.
Copy link
Member

Choose a reason for hiding this comment

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

I think you can merge these:

Suggested change
* Let :math:`C'` be the same :ref:`context <context>` as :math:`C`, but with the first label popped from the |CLABELS| vector.
* Let :math:`C''` be the same :ref:`context <context>` as :math:`C`, but with the label :math:`[t^\ast]` prepended to the |CLABELS| vector.
* Let :math:`C''` be the same :ref:`context <context>` as :math:`C'`, but with the label type :math:`(\LCATCH~[t^\ast])` prepended to the |CLABELS| vector.
* Let :math:`C''` be the same :ref:`context <context>` as :math:`C`, but with the label type :math:`(\LCATCH~[t^\ast])` replacing the first element of the |CLABELS| vector.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For some reason I couldn't apply the suggestions but I added these changes to the latest commit I just pushed.

}{
S; C,\CLABELS\,[t^\ast] \vdashadmininstr \CAUGHTadm\{\tagaddr~\val^\ast\}~\instr^\ast~\END : [] \to [t^\ast]
S; C',\CLABELS\,(\LCATCH^?~[t^\ast]) \vdashadmininstr \CAUGHTadm\{\tagaddr~\val^\ast\}~\instr^\ast~\END : [] \to [t^\ast]
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we can or want to allow this to be a catch label beforehand already.

Suggested change
S; C',\CLABELS\,(\LCATCH^?~[t^\ast]) \vdashadmininstr \CAUGHTadm\{\tagaddr~\val^\ast\}~\instr^\ast~\END : [] \to [t^\ast]
S; C',\CLABELS\,[t^\ast] \vdashadmininstr \CAUGHTadm\{\tagaddr~\val^\ast\}~\instr^\ast~\END : [] \to [t^\ast]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same as above

ioannad added a commit that referenced this pull request Dec 23, 2022
#241)

This addresses additional review comments to PR #222, that were made after it was merged.
The last review comment in the discussion suggests to adjust all validation labels to use label types instead of just result types.
Should address all occurrences of validation labels.

Additionally adds a boolean catch_label to control frames in the validation algorithm,
and some related functionality, fixing the cases for opcodes `catch` and `catch_all`.

* Apply suggestions from code review

Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Heejin Ahn <[email protected]>

* Reverting changes to typing of CAUGHTadm.

Changes to this rule are now done in PR #244
ioannad added a commit to ioannad/exception-handling that referenced this pull request Feb 15, 2023
In particular:
- Switched to
    handler ::= (tagaddr? instr*)* | labelidx
    exn ::= tagaddr val*
    instr ::= … | handler_n{handler} instr* end | caught_n{exn} instr* end
  removing DELEGATEadm
- Changed prose to just push and pop handlers and exceptions, in the runtime,
  in the execution steps of the instructions, in the formal overview,
  and partly in appendix/properties.

Not done:
- Did not change the notation and prose for CAUGHTadm
  in appendix/properties.rst, this will be done in PR WebAssembly#244.
ioannad and others added 2 commits February 15, 2023 17:15
- Also added the missing _n to CAUGHTadm.
  The subscript is introduced by the changes in PR WebAssembly#226
@ioannad
Copy link
Collaborator Author

ioannad commented Feb 15, 2023

Applied the suggestions manually, it seemed impossible otherwise. Merging.

@ioannad ioannad merged commit ebb56a5 into WebAssembly:main Feb 15, 2023
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.

2 participants