]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Correctly propagate the errors thrown when variable destruction happens at compile...
authorVincent Pit <vince@profvince.com>
Wed, 13 Jan 2010 01:07:57 +0000 (02:07 +0100)
committerVincent Pit <vince@profvince.com>
Wed, 13 Jan 2010 01:07:57 +0000 (02:07 +0100)
Magic.xs

index fa09ec197eaaf5f4adda03367ff45c0bc47582c8..735683c600e192599122ac3d8785809a5fcb68d4 100644 (file)
--- 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;