This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
We shouldn't try to decrement the refcount of PL_warnhook
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 7 Aug 2006 14:10:15 +0000 (14:10 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 7 Aug 2006 14:10:15 +0000 (14:10 +0000)
if it has been set to PERL_WARNHOOK_FATAL.

p4raw-id: //depot/perl@28669

mg.c

diff --git a/mg.c b/mg.c
index 8e00fb2..3f2fd5a 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1384,7 +1384,8 @@ Perl_magic_setsig(pTHX_ SV *sv, MAGIC *mg)
            Perl_croak(aTHX_ "No such hook: %s", s);
        i = 0;
        if (*svp) {
-           to_dec = *svp;
+           if (*svp != PERL_WARNHOOK_FATAL)
+               to_dec = *svp;
            *svp = NULL;
        }
     }