From: Steve Grazzini Date: Sun, 15 Jun 2003 21:02:26 +0000 (+0000) Subject: unnecessary stringification in eval/die X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=168696769693b5e65a30c0a0a677c7f648e8370e;p=p5sagit%2Fp5-mst-13.2.git unnecessary stringification in eval/die Message-ID: <20030615210226.56430.qmail@onion.perl.org> (See also in c.l.p.misc and bug #17763) p4raw-id: //depot/perl@19800 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index ac20efc..a36cda0 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -1125,7 +1125,7 @@ This is useful for propagating exceptions: If LIST is empty and C<$@> contains an object reference that has a C method, that method will be called with additional file and line number parameters. The return value replaces the value in -C<$@>. ie. as if C<<$@ = eval { $@->PROPAGATE(__FILE__, __LINE__) };>> +C<$@>. ie. as if C<< $@ = eval { $@->PROPAGATE(__FILE__, __LINE__) }; >> were called. If C<$@> is empty then the string C<"Died"> is used. diff --git a/pp_ctl.c b/pp_ctl.c index f726ab7..95ea793 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1365,8 +1365,6 @@ Perl_die_where(pTHX_ char *message, STRLEN msglen) sv_setpvn(ERRSV, message, msglen); } } - else - message = SvPVx(ERRSV, msglen); while ((cxix = dopoptoeval(cxstack_ix)) < 0 && PL_curstackinfo->si_prev) @@ -1383,6 +1381,8 @@ Perl_die_where(pTHX_ char *message, STRLEN msglen) POPBLOCK(cx,PL_curpm); if (CxTYPE(cx) != CXt_EVAL) { + if (!message) + message = SvPVx(ERRSV, msglen); PerlIO_write(Perl_error_log, "panic: die ", 11); PerlIO_write(Perl_error_log, message, msglen); my_exit(1);