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

Interaction of try...catch_br l with unwind blocks. #130

Closed
@ioannad

Description

@ioannad

Say we have a catch_br l in the try instructions of a try...unwind...end instruction (an unwind block), and l is "outside" the unwind block, and an exception is thrown by the try of the try...catch_br l. IIUC, the thrown exception is then caught in the try block with label l, 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 between catch_br and unwind 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.

i32.const 11
global.set 0
try $l
  try
    try
      throw x
    catch_br $l
  unwind
    i32.const 27
    global.set 0
  end
catch_all
end
global.get 0

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 label l?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions