# New Ticket Created by chromatic
# Please include the string: [perl #56308]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=56308 >
This patch makes t/pmc/coroutine.t pass in the pdd25 cx branch. The offending
code is:
.pcc_sub _coro:
push_eh _catchc
corolp:
get_global P17, "i"
dec P17
yield
branch corolp
_catchc:
get_results '0, 0' , P5, S0
print "catch coro\n"
end
In PIR terms, this is a sub named _coro which pushes an exception handler onto
the stack, decrements a global variable named "i", then yields (being a
coroutine).
In the pdd25cx branch, the exception handler is not scoped to this sub; it's
global. Thus when something outside of the coroutine throws an exception,
the coroutine's exception handler may handle it. That's probably not exactly
what people expect.
One fix is to add "pop_eh" before "yield", to clean up the exception handler
in this scope. That may be the right fix, but this action at a distance is
to me a little surprising.
-- c
Index: t/pmc/coroutine.t
===================================================================
--- t/pmc/coroutine.t (revision 28683)
+++ t/pmc/coroutine.t (working copy)
@@ -134,6 +134,7 @@
corolp:
get_global P17, "i"
dec P17
+ pop_eh
yield
branch corolp
_catchc: