diff options
author | Spider Boardman <spider@orb.nashua.nh.us> | 2002-03-28 19:52:24 -0500 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2002-03-29 07:28:29 +0000 |
commit | 020f0e03c64f319bb529fa80a5fe18adf2ad1fa6 (patch) | |
tree | 4bb60c2efda08588ea353804740d6322e5ae87fd | |
parent | 6cd7d6d64cacefc21eb167e634fbe11515e68308 (diff) | |
download | perl-020f0e03c64f319bb529fa80a5fe18adf2ad1fa6.tar.gz |
Re: perl 5.7.3 + XS lvalue subs
Message-Id: <200203290552.AAA47443@leggy.zk3.dec.com>
p4raw-id: //depot/perl@15592
-rw-r--r-- | op.c | 2 | ||||
-rw-r--r-- | t/op/attrs.t | 8 |
2 files changed, 10 insertions, 0 deletions
@@ -4899,6 +4899,8 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) */ if (cv && !block) { rcv = (SV*)cv; + /* Might have had built-in attributes applied -- propagate them. */ + CvFLAGS(cv) |= (CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS); if (CvGV(cv) && GvSTASH(CvGV(cv))) stash = GvSTASH(CvGV(cv)); else if (CvSTASH(cv)) diff --git a/t/op/attrs.t b/t/op/attrs.t index 8e04936f8d..1ed92a1a8d 100644 --- a/t/op/attrs.t +++ b/t/op/attrs.t @@ -180,6 +180,14 @@ eval 'package A; sub X { $_[0] } sub X : lvalue'; mytest '', "@attrs", "lvalue"; BEGIN {++$ntests} +# Above not with just 'pure' built-in attributes. +sub Z::MODIFY_CODE_ATTRIBUTES { (); } +eval 'package Z; sub L { $_[0] } sub L : Z lvalue'; +@attrs = eval 'attributes::get \&Z::L'; +mytest '', "@attrs", "lvalue Z"; +BEGIN {++$ntests} + + # Begin testing attributes that tie { |