Repository navigation
Fix resolution of delegate labels - #1675
Merged
Merged
Conversation
aheejin
reviewed
Jun 26, 2021
aheejin
left a comment
Member
There was a problem hiding this comment.
Sorry for the late reply! Can we split the two fixes into two separate PRs?
The labels for a try-delegate should start resolving one block
further out than usual. Example:
try $l1
try $l2
call $foo
delegate $l1 ;; (= delegate 0)
end
Using $l2 is an error as try-delegate cannot target it.
takikawa
force-pushed
the
fix-delegate-labels
branch
from
June 29, 2021 00:51
a32df0c to
927c54f
Compare
Contributor
Author
No problem, I've split the printing fix out as #1685 now. |
takikawa
commented
Jun 29, 2021
| // immediately enclosing try block. | ||
| delegate_target->set_index(delegate_target->index() - 1); | ||
| } | ||
| // Pop the label here as a try-delegate has no `end` instruction. |
Contributor
Author
There was a problem hiding this comment.
Note: I added this line in the latest revision, as this was another bug in this resolution code. (it is sufficiently tested by the dump test case I added---without the pop the $try1 label was off because it came after another try-delegate.)
Contributor
Author
|
In order to make the two split PRs mergeable in any order, I changed the test addition in this PR. Instead of testing in |
aheejin
reviewed
Jun 29, 2021
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.
This PR has two commits for fixing bugs related to try-delegate labels.
One fixes the printing in certain cases (similar to #1609).
The other fixes the label resolution code. Example from the spec (https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md):
The label
$l1should resolve to0in the delegate target, which is 1 less than how typical block constructs work. The current code mis-resolves this to1. It should also error in cases like the following:Because it's not possible to represent the label
$l1in the binary format, as atry-delegatecannot target itself.