diff options
author | Zefram <zefram@fysh.org> | 2009-12-15 11:48:31 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-12-15 11:48:31 +0100 |
commit | 421f30ed1e95009450bdc7905bf3433ee806ea4f (patch) | |
tree | 7bb77079cef0499e14323d0b6ec49fd59718199a /perly.y | |
parent | 15dc519fb7cb1c4b51fbc196af8ecf273c534ad1 (diff) | |
download | perl-421f30ed1e95009450bdc7905bf3433ee806ea4f.tar.gz |
[perl #22977] Bug in format/write
Diffstat (limited to 'perly.y')
-rw-r--r-- | perly.y | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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); + } } ; |