# New Ticket Created by Stephen Weeks # Please include the string: [perl #58170] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=58170 >
There are some issues that need to be resolved for resumable exceptions. The first issue I've run into is that Parrot_cx_find_handler_local marks the exception handler as used when it finds it and ignores already-used exception handlers. The following PIR fails: .sub main :main say "start" push_eh handler $P0 = new 'Exception' $P0 = "Exception 1" throw $P0 $P0 = new 'Exception' $P0 = "Exception 2" throw $P0 pop_eh say "end" exit 0 handler: .local pmc exception .local string message .local pmc continuation .get_results(exception,message) continuation = exception['retcont'] print "handled exception: " say message continuation() .end Parrot_cx_find_handler_local uses an iterator for handlers for Exceptions, but just walks all the handlers ignoring used ones for everything else. It looks like maybe if everything stored their handlers in an iterator, as the comment suggest is possible, we could discard the used check? A few experiments into this turn up segfaults and other odd behavior. Maybe we need to have a 'cleanup' function for exception handlers to call instead?