summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGerard Goossen <gerard@ggoossen.net>2009-12-27 18:02:37 +0100
committerRafael Garcia-Suarez <rgs@consttype.org>2010-01-10 23:50:36 +0100
commiteac910c876359d864e67b412fa2d9f03b5ba8a0b (patch)
tree096ce89b99906b319e224b554dd62c3b5dd1b0ad /op.c
parent885ef6f56b61fd750ef3b1fa614d11480baac635 (diff)
downloadperl-eac910c876359d864e67b412fa2d9f03b5ba8a0b.tar.gz
Retain builtin attributes from pre-declaration. Fixes [perl #68758].
Diffstat (limited to 'op.c')
-rw-r--r--op.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/op.c b/op.c
index db17d142f1..a7205cb9f7 100644
--- a/op.c
+++ b/op.c
@@ -5785,8 +5785,9 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
&& block->op_type != OP_NULL
#endif
) {
+ cv_flags_t existing_builtin_attrs = CvFLAGS(cv) & CVf_BUILTIN_ATTRS;
cv_undef(cv);
- CvFLAGS(cv) = CvFLAGS(PL_compcv);
+ CvFLAGS(cv) = CvFLAGS(PL_compcv) | existing_builtin_attrs;
if (!CvWEAKOUTSIDE(cv))
SvREFCNT_dec(CvOUTSIDE(cv));
CvOUTSIDE(cv) = CvOUTSIDE(PL_compcv);