-
Notifications
You must be signed in to change notification settings - Fork 36
Interaction of try...catch_br l
with unwind
blocks.
#130
Comments
@ioannad here's a section from the meeting notes that may be relevant:
|
@KronicDeth, thank you so much, it seems I didn't understand that part of the conversation live (I was in that meeting 😊 )
This makes me think I might have misunderstood the roles of
This seems to say that my example above should return 11, not 27. So it seems that during a throw, not all intermediate unwind blocks execute their cleanup forms, but only those targeted by a |
That is my interpretation.
I think that's only true upto the |
Ok, that makes sense, thank you! It's late here now, I'll edit the draft formal spec comment to match this semantics tomorrow or (probably) Monday. |
To close this issue, @aheejin do you agree with @KronicDeth 's interpretation?:
Where "jump over it" means that the unwind block's cleanup forms are not executed, I presume. |
Sorry for the late reply. |
Looking ahead for compatibility with possible extensions, what happens if one were to do an
|
We don't have a concept called 'unwinding branch' now, so I'm not sure if that can be answered. Also |
My concern is that all the answers I have thought of have problems with this skip-over semantics from what I can tell. I had originally thought |
How are these two different? I mean, "Reuse an outer |
* Fix outdated stuff * Update Overview.md * Update Overview.md * Update Overview.md * Clarify zero table index * Address review comments
Say we have a
catch_br l
in thetry
instructions of atry...unwind...end
instruction (an unwind block), andl
is "outside" the unwind block, and an exception is thrown by thetry
of thetry...catch_br l
. IIUC, the thrown exception is then caught in the try block with labell
, and it seems reasonable to assume that, when unwinding that throw, the cleanup forms of the intermediate unwind block would get triggered. This is how I described the interaction betweencatch_br
andunwind
in my draft formal spec for this 3rd EH proposal. Is this the intended behaviour?A concrete example in case my explanation wasn't clear enough.
Does the above return 27 (as I would expect), or 11?
The question in general:
Does
catch_br l
trigger unwind-cleanup code from unwind blocks between itself and its destination labell
?The text was updated successfully, but these errors were encountered: