Change 18485 by rgs@rgs-home on 2003/01/15 20:10:57
Subject: [PATCH] Re: [perl #19566] Perl 5.8.0 segfault
From: Stephen McCamant <[EMAIL PROTECTED]>
Date: Thu, 2 Jan 2003 18:08:23 -0500
Message-ID: <[EMAIL PROTECTED]>
Plus a test by Jarkko
Integrated from changes 18444 and 18446 from maint-5.8
Affected files ...
... //depot/perl/MANIFEST#965 integrate
... //depot/perl/pp_hot.c#299 integrate
... //depot/perl/t/op/readline.t#1 branch
Differences ...
==== //depot/perl/MANIFEST#965 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#964~18484~ Wed Jan 15 06:09:57 2003
+++ perl/MANIFEST Wed Jan 15 12:10:57 2003
@@ -2601,6 +2601,7 @@
t/op/rand.t See if rand works
t/op/range.t See if .. works
t/op/read.t See if read() works
+t/op/readline.t See if <> / readline work
t/op/readdir.t See if readdir() works
t/op/recurse.t See if deep recursion works
t/op/ref.t See if refs and objects work
==== //depot/perl/pp_hot.c#299 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#298~18456~ Tue Jan 7 01:20:22 2003
+++ perl/pp_hot.c Wed Jan 15 12:10:57 2003
@@ -1466,6 +1466,8 @@
report_evil_fh(PL_last_in_gv, io, PL_op->op_type);
}
if (gimme == G_SCALAR) {
+ /* undef TARG, and push that undefined value */
+ SV_CHECK_THINKFIRST_COW_DROP(TARG);
(void)SvOK_off(TARG);
PUSHTARG;
}
@@ -1527,6 +1529,7 @@
}
}
if (gimme == G_SCALAR) {
+ SV_CHECK_THINKFIRST_COW_DROP(TARG);
(void)SvOK_off(TARG);
SPAGAIN;
PUSHTARG;
==== //depot/perl/t/op/readline.t#1 (text) ====
Index: perl/t/op/readline.t
--- /dev/null Tue May 5 13:32:27 1998
+++ perl/t/op/readline.t Wed Jan 15 12:10:57 2003
@@ -0,0 +1,13 @@
+#!./perl
+
+BEGIN {
+ chdir 't';
+ @INC = '../lib';
+ require './test.pl';
+}
+
+plan tests => 1;
+
+eval { for (\2) { $_ = <FH> } };
+like($@, 'Modification of a read-only value attempted', '[perl #19566]');
+
End of Patch.