fyi, this was the cause of modules/cgi #3 test failure..
---------- Forwarded message ----------
Date: Wed, 1 Aug 2001 09:47:28 -0700 (PDT)
From: Doug MacEachern <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [patch] ithreads + refto bug
strange bug, happens in both 5.6.x and bleedperl, the following script:
package Foo;
use strict;
sub TIEHANDLE { bless {} }
my $cnt = 'a';
sub READ {
$_[1] = $cnt++;
1;
}
sub do_read {
my $fh = shift;
read $fh, my $buff, 1;
print "->$buff<-\n";
}
$|=1;
tie *STDIN, 'Foo';
read STDIN, my $buff, 1;
print "=>$buff<=\n";
do_read(\*STDIN);
untie *STDIN;
prints:
=>a<=
then in the call to do_read(\*STDIN), $fh is no longer tied.
with vanilla (non-ithreads) Perl, it prints the expected:
=>a<=
->b<-
the bug seems to be S_refto (called by pp_srefgen), which the patch below
fixes, all tests pass.
Index: pp.c
===================================================================
RCS file: /usr/local/cvs_repository/perl-current-mirror/pp.c,v
retrieving revision 1.1.1.33
diff -u -r1.1.1.33 pp.c
--- pp.c 2001/07/31 15:56:35 1.1.1.33
+++ pp.c 2001/08/01 16:37:16
@@ -467,7 +467,7 @@
SvTEMP_off(sv);
(void)SvREFCNT_inc(sv);
}
- else if (SvPADTMP(sv))
+ else if (SvPADTMP(sv) && !(isGV(sv) && GvIN_PAD(sv)))
sv = newSVsv(sv);
else {
SvTEMP_off(sv);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]