From: Gurusamy Sarathy Date: Wed, 14 Oct 1998 05:37:10 +0000 (+0000) Subject: let docatch() pass the buck when restartop turns out to be null, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ebf99b04cc4af488057bd9d08bb6a2768960923c;p=p5sagit%2Fp5-mst-13.2.git let docatch() pass the buck when restartop turns out to be null, making exceptions in BEGIN{} propagate as expected p4raw-id: //depot/perl@1947 --- 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.