This repository was archived by the owner on Apr 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Adds validation for exception results. #254
Merged
ioannad
merged 7 commits into
WebAssembly:main
from
ioannad:validation-for-exception-results
Apr 21, 2023
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cbe1701
Adds validation for exception results.
ioannad 4171c4a
Apply suggestions from code review
ioannad 6635204
Addressed review comments.
ioannad 599a343
addressed review comments
ioannad af1bcb2
Apply suggestions from code review
ioannad 602a10a
Addressing review comment https://github.com/WebAssembly/exception-ha…
ioannad bac761f
Merged the first three steps to one reflecting what is done in THROWa…
ioannad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,8 +58,31 @@ Results | |
S \vdashresult \TRAP : [t^\ast] | ||
} | ||
|
||
.. todo:: | ||
Add validation for exception results. | ||
|
||
:ref:`Results <syntax-result>` :math:`\val^\ast~(\THROWadm~\tagaddr)` | ||
..................................................................... | ||
|
||
* The :ref:`external value <syntax-externval>` :math:`\EVTAG~\tagaddr` must be :ref:`valid <valid-externval-tag>` with some :ref:`external type <syntax-externtype>` :math:`\ETTAG~\tagtype`. | ||
|
||
* Let :math:`[t^\ast]\to[t_0^\ast]` be the :ref:`tag type <syntax-tagtype>` |tagtype|. | ||
|
||
* Assert: due to :ref:`validation <valid-externval-tag>` the type sequence :math:`t_0^\ast` must be empty. | ||
|
||
* For each :ref:`value <syntax-val>` :math:`\val_i` in :math:`\val^\ast`: | ||
ioannad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* The value :math:`\val_i` must be :ref:`valid <valid-val>` with :ref:`value type <syntax-valtype>` :math:`t_i`. | ||
|
||
* Then the result is valid with :ref:`result type <syntax-resulttype>` :math:`[{t'}^\ast]`, for any sequence :math:`{t'}^\ast` of :ref:`value types <syntax-valtype>`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a name clash, this is a different There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed the first occurrence to |
||
|
||
|
||
.. math:: | ||
\frac{ | ||
S \vdashexternval \EVTAG~\tagaddr : \ETTAG~[t^\ast] \to [] | ||
\qquad | ||
(S \vdashval \val : t)^\ast | ||
}{ | ||
S \vdashresult \val^\ast~(\THROWadm~\tagaddr) : [{t'}^\ast] | ||
} | ||
|
||
|
||
.. _module-context: | ||
|
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.
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.
This isn't actually an assertion -- this rule is the very one that validates this property for results. ;)
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.
Doesn't the first line (L.65) do this validation?
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 guess that's the justification, so removing the "Assert:"