From ebf99b04cc4af488057bd9d08bb6a2768960923c Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Wed, 14 Oct 1998 05:37:10 +0000 Subject: [PATCH] let docatch() pass the buck when restartop turns out to be null, making exceptions in BEGIN{} propagate as expected p4raw-id: //depot/perl@1947 --- pp_ctl.c | 7 +++---- t/op/misc.t | 12 ++++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pp_ctl.c b/pp_ctl.c index 332b24c..c882e9e 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -2308,15 +2308,14 @@ docatch(OP *o) JMPENV_PUSH(ret); switch (ret) { default: /* topmost level handles it */ +pass_the_buck: JMPENV_POP; PL_op = oldop; JMPENV_JUMP(ret); /* NOTREACHED */ case 3: - if (!PL_restartop) { - PerlIO_printf(PerlIO_stderr(), "panic: restartop\n"); - break; - } + if (!PL_restartop) + goto pass_the_buck; PL_op = PL_restartop; PL_restartop = 0; /* FALL THROUGH */ diff --git a/t/op/misc.t b/t/op/misc.t index 7292ffe..667db98 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -418,3 +418,15 @@ EXPECT destroyed destroyed ######## +BEGIN { + $| = 1; + $SIG{__WARN__} = sub { + eval { print $_[0] }; + die "bar\n"; + }; + warn "foo\n"; +} +EXPECT +foo +bar +BEGIN failed--compilation aborted at - line 8. -- 2.7.4