summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-05-10 14:47:58 +0000
committerNicholas Clark <nick@ccl4.org>2005-05-10 14:47:58 +0000
commitea6e9374082ba65411b39d56a62387c8a2bd2879 (patch)
tree40c40ac11df15915d4a630104181dc607aee2498 /op.c
parentd2a1eec3cd6825dde834f852934b2f286fab1f9f (diff)
downloadperl-ea6e9374082ba65411b39d56a62387c8a2bd2879.tar.gz
As we have the length of the string easily to hand, no reason not to
use it. p4raw-id: //depot/perl@24438
Diffstat (limited to 'op.c')
-rw-r--r--op.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/op.c b/op.c
index 446bb5942f..e852f47c6c 100644
--- a/op.c
+++ b/op.c
@@ -4234,6 +4234,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
const char *aname;
GV *gv;
char *ps;
+ STRLEN ps_len;
register CV *cv=0;
SV *const_sv;
@@ -4241,7 +4242,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
if (proto) {
assert(proto->op_type == OP_CONST);
- ps = SvPVx(((SVOP*)proto)->op_sv, n_a);
+ ps = SvPVx(((SVOP*)proto)->op_sv, ps_len);
}
else
ps = Nullch;
@@ -4281,7 +4282,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
cv_ckproto((CV*)gv, NULL, ps);
}
if (ps)
- sv_setpv((SV*)gv, ps);
+ sv_setpvn((SV*)gv, ps, ps_len);
else
sv_setiv((SV*)gv, -1);
SvREFCNT_dec(PL_compcv);
@@ -4434,7 +4435,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
CvSTASH(cv) = PL_curstash;
if (ps)
- sv_setpv((SV*)cv, ps);
+ sv_setpvn((SV*)cv, ps, ps_len);
if (PL_error_count) {
op_free(block);