New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in format/write #6624
Comments
From schopper@usm.uni-muenchen.deHi there, I belive, that we've found a bug in perl. We discovered it when changing from We found, that write no longer use the actual values of the variables A sample program would be: 1 #!/usr/lib/perl5/neu/usr-bin/perl -w This gives the wrong output: But when we comment out line 5 we get the right result: The old (correct) version of perl is:Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration: Characteristics of this binary (from libperl): The new (buggy) Version is:Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Characteristics of this binary (from libperl): Thanks in advance for any help you can give. With best regards Rüdiger Schopper GPG/PGP-Key: _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ |
From @iabynOn Mon, Jul 14, 2003 at 05:37:42AM -0000, Ruediger Schopper wrote:
The bug can be reduced to the simpler case: sub f ($); # Comment out to get right result! It's due to there being multiple CVs associated with f due to to the Since I'm currently working on trying to get sub declarations -- |
From schopper@usm.uni-muenchen.deHi Dave, thanks for the extremely fast response. I would like to know if we might be Our problem is, that we have to upgrade perl eventually, so we are in principle I don't want to annoy you, so just give us a short notice, if you like. Best regards Rüdiger
GPG/PGP-Key: _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ |
From @iabynOn Mon, Jul 21, 2003 at 05:43:39PM +0200, Ruediger Schopper wrote:
Thanks for the kind offer, but I don't think that giving money to me However, if you want to contribute financially to the development of Perl I am hoping to have a patch ready in 2-3 weeks time, but it's Of course, I may find that I can't fix it after all... Regards, Dave. -- |
From schopper@usm.uni-muenchen.deHi Dave, do you have any news concerning the subroutine/format bug I sent you a With best regards Rüdiger
GPG/PGP-Key: _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ |
From @iabynOn Tue, Sep 02, 2003 at 01:28:58PM +0200, Ruediger Schopper wrote:
I'm working on a opath, bug have got side-tracked with things more
-- |
From @iabynOn Tue, Sep 02, 2003 at 09:01:05PM +0100, Dave Mitchell wrote: Would have helped if I'd proof-read it before hitting the send key. I'm working on a patch, but have got side-tracked with things more -- |
From Alexander.stohr@gmx.deIt seems to me that this bug is still a pending one. #!/usr/bin/perl -w Results are: ARRAY(0x81317a4) 101 (loop) ARRAY(0x8131888) 102 (loop) |
From p5p@spam.wizbit.beOn Mon Jul 14 15:15:03 2003, davem wrote:
It appears that things got worse for 5.10.0/blead... perl-5.8.8 rt-22977.pl (Instead of 1 2) perl-5.9.0 rt-22977.pl perl-5.10.0 rt-22977.pl perl-blead rt-22977.pl |
From @andk
> It appears that things got worse for 5.10.0/blead... Binary search reveals... ----Program---- ----Output of .../pMZAcVt/perl-5.8.0@19648/bin/perl---- ----EOF ($?='0')---- ----EOF ($?='11')---- Change 19649 by rgs@rgs-home on 2003/05/31 18:33:07 Subject: [PATCH] jumbo closure patch broke formats -- |
From @nwc10Dave notes: Was a format/closure/newATTSUB bug in 5.8.8; in 5.10.0, maint, blead, it |
From chromatic@wgz.orgOn Friday 27 June 2008 12:04:09 Bram via RT wrote:
That's the same bug as RT #50528. -- c |
From zefram@fysh.orgAttached patch fixes bug #22977. make regen_perly after applying. -zefram |
From zefram@fysh.orgInline Patchdiff --git a/perly.y b/perly.y
index 18e5875..a61a6b3 100644
--- a/perly.y
+++ b/perly.y
@@ -511,7 +511,9 @@ peg : PEG
;
format : FORMAT startformsub formname block
- { SvREFCNT_inc_simple_void(PL_compcv);
+ {
+ CV *fmtcv = PL_compcv;
+ SvREFCNT_inc_simple_void(PL_compcv);
#ifdef MAD
$$ = newFORM($2, $3, $4);
prepend_madprops($1->tk_mad, $$, 'F');
@@ -521,6 +523,10 @@ format : FORMAT startformsub formname block
newFORM($2, $3, $4);
$$ = (OP*)NULL;
#endif
+ if (CvOUTSIDE(fmtcv) && !CvUNIQUE(CvOUTSIDE(fmtcv))) {
+ SvREFCNT_inc_simple_void(fmtcv);
+ pad_add_anon((SV*)fmtcv, OP_NULL);
+ }
}
;
diff --git a/t/comp/form_scope.t b/t/comp/form_scope.t
new file mode 100644
index 0000000..3ef891e
--- /dev/null
+++ b/t/comp/form_scope.t
@@ -0,0 +1,18 @@
+#!./perl
+#
+# Tests bug #22977. Test case from Dave Mitchell.
+
+print "1..2\n";
+
+sub f ($);
+sub f ($) {
+my $test = $_[0];
+write;
+format STDOUT =
+ok @<<<<<<<
+$test
+.
+}
+
+f(1);
+f(2); |
From @rgarcia2009/12/15 Zefram <zefram@fysh.org>:
Thanks, applied, regenerated, and MANIFEST completed. |
@rgs - Status changed from 'open' to 'resolved' |
From @cpansproutOn Tue Dec 15 02:49:25 2009, rgs@consttype.org wrote:
The commit id was 421f30e. The commit message did not explain: It follows Dave Mitchell’s -- Father Chrysostomos |
Migrated from rt.perl.org#22977 (status was 'resolved')
Searchable as RT22977$
The text was updated successfully, but these errors were encountered: