summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-05-06 22:17:04 +0000
committerNicholas Clark <nick@ccl4.org>2005-05-06 22:17:04 +0000
commit9cfa90c07dda2bbf7df20096eab1b9057035d586 (patch)
treeba81ae3962d4ec6640cea3d94d57d65b9ee3691f /perlio.c
parentc3929b7290197fd6055681e2dabb11ad55efccae (diff)
downloadperl-9cfa90c07dda2bbf7df20096eab1b9057035d586.tar.gz
Get the correct refcount on the temporary assignment to PL_sigwarn so
that other code assigning to $SIG{__WARN__} doesn't cause a premature free. p4raw-id: //depot/perl@24410
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/perlio.c b/perlio.c
index fbe8da235c..f437222357 100644
--- a/perlio.c
+++ b/perlio.c
@@ -762,7 +762,8 @@ PerlIO_find_layer(pTHX_ const char *name, STRLEN len, int load)
ENTER;
SAVEINT(PL_in_load_module);
if (cv) {
- SAVESPTR(PL_warnhook);
+ SAVEGENERICSV(PL_warnhook);
+ SvREFCNT_inc(cv);
PL_warnhook = (SV *) cv;
}
PL_in_load_module++;
@@ -5039,3 +5040,13 @@ PerlIO_sprintf(char *s, int n, const char *fmt, ...)
return result;
}
#endif
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ *
+ * vim: shiftwidth=4:
+*/