that other code assigning to $SIG{__WARN__} doesn't cause a premature
free.
p4raw-id: //depot/perl@24410
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++;
return result;
}
#endif
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ *
+ * vim: shiftwidth=4:
+*/
$UNICODE_STDIN = 1;
}
}
-my $NTEST = 43 - (($DOSISH || !$FASTSTDIO) ? 7 : 0) - ($DOSISH ? 5 : 0)
+my $NTEST = 44 - (($DOSISH || !$FASTSTDIO) ? 7 : 0) - ($DOSISH ? 5 : 0)
+ $UNICODE_STDIN;
sub PerlIO::F_UTF8 () { 0x00008000 } # from perliol.h
close G;
}
+ # Check that PL_sigwarn's reference count is correct, and that
+ # &PerlIO::Layer::NoWarnings isn't prematurely freed.
+ fresh_perl_like (<<'EOT', qr/^CODE/);
+open(UTF, "<:raw:encoding(utf8)", $^X) or die $!;
+print ref *PerlIO::Layer::NoWarnings{CODE};
+EOT
+
1 while unlink "afile";
}