On Tue Aug 05 04:09:14 2008, tene wrote: > pdd23: > > Exception handlers can resume execution immediately after the > "throw" opcode by invoking the resume continuation which is stored > in the exception object. That continuation must be invoked with no > parameters; in other words, "throw" never returns a value. > > Exception.pmc has the following attributes: > > ATTR INTVAL id; /* The task ID in the scheduler. */ > ATTR FLOATVAL birthtime; /* The creation time stamp of the > exception. */ > ATTR STRING *message; /* The exception message. */ > ATTR PMC *payload; /* The payload for the exception. */ > ATTR INTVAL severity; /* The severity of the exception. */ > ATTR INTVAL type; /* The type of the exception. */ > ATTR INTVAL exit_code; /* The exit code of the exception. */ > ATTR PMC *stacktrace; /* The stacktrace of an exception. */ > ATTR INTVAL handled; /* Whether the exception has been > handled. */ > ATTR PMC *handler_iter; /* An iterator of handlers (for > rethrow). */ > ATTR Parrot_Context *handler_ctx; /* A stored context for handler > iterator. */ > > None of these is a continuation. > > The throw opcode passes the address of the next opcode to > Parrot_ex_throw_from_op, but Petfo only uses it in: > > address = VTABLE_invoke(interp, handler, dest); > > and the ExceptionHandler PMC's invoke() does not use that parameter > at all. > > > This first draft of a patch adds an attribute to the exception pmc to > hold a return continuation, creates a retcontinuation pmc in the throw > opcode and assigns it to that attribute, and patches > new_ret_continuation to initialize the new continuation's from_ctx > attribute in the same way new_continuation does. > > This last item is there to fix a segfault. I don't understand > parrot's > continuations well enough yet to have any idea why they were > different, > so I just guessed. I don't know if it's wrong, but it doesn't seem to > fail any extra tests. > > Added a simple test case.
It looks like Allison applied your patch in r30123 but forgot to close this ticket. Now seems like a good time to resolve it. Thanks for the patch.