From 5bbe7184a7198d6334733fd9eb3ca7db21bf04f2 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Fri, 27 Jul 2012 18:05:02 -0700 Subject: [PATCH] pp.c:pp_trans: avoid redundant sv in transr 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pp.c b/pp.c index 0def4ac..a57f609 100644 --- 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; } -- 2.7.4