From: Vincent Pit Date: Wed, 13 Jan 2010 01:07:57 +0000 (+0100) Subject: Correctly propagate the errors thrown when variable destruction happens at compile... X-Git-Tag: v0.41~4 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=commitdiff_plain;h=89a8c76d2a3e14d7b1b4d78a7ca4e327898b94d4 Correctly propagate the errors thrown when variable destruction happens at compile-time --- diff --git a/Magic.xs b/Magic.xs index fa09ec1..735683c 100644 --- a/Magic.xs +++ b/Magic.xs @@ -1098,8 +1098,16 @@ STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) { #endif has_err = SvTRUE(ERRSV); - if (IN_PERL_COMPILETIME && !had_err && has_err) - ++PL_error_count; + if (IN_PERL_COMPILETIME && !had_err && has_err) { + if (PL_errors) + sv_catsv(PL_errors, ERRSV); + else + Perl_warn(aTHX_ "%s", SvPV_nolen(ERRSV)); +#ifdef PL_parser + if (PL_parser) +#endif + ++PL_error_count; + } SPAGAIN; svr = POPs;