projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8589767
)
pp.c:pp_trans: avoid redundant sv in transr
author
Father Chrysostomos
<sprout@cpan.org>
Sat, 28 Jul 2012 01:05:02 +0000
(18:05 -0700)
committer
Father Chrysostomos
<sprout@cpan.org>
Sat, 28 Jul 2012 01:07:29 +0000
(18:07 -0700)
I think I added the if (OP_TRANSR) block to the wrong spot, because the
mortal scalar created just before it is only used for y/// without /r.
pp.c
patch
|
blob
|
history
diff --git
a/pp.c
b/pp.c
index
0def4ac
..
a57f609
100644
(file)
--- a/
pp.c
+++ b/
pp.c
@@
-676,7
+676,6
@@
PP(pp_trans)
sv = DEFSV;
EXTEND(SP,1);
}
- TARG = sv_newmortal();
if(PL_op->op_type == OP_TRANSR) {
STRLEN len;
const char * const pv = SvPV(sv,len);
@@
-684,7
+683,10
@@
PP(pp_trans)
do_trans(newsv);
PUSHs(newsv);
}
- else PUSHi(do_trans(sv));
+ else {
+ TARG = sv_newmortal();
+ PUSHi(do_trans(sv));
+ }
RETURN;
}