diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-06-24 21:28:36 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-07-25 23:48:01 -0700 |
commit | da9e430b54f7fcb43be1674882e31b92f2aa8253 (patch) | |
tree | 373c3b6702d80b68e8a3aa43f4216736dbd1cc41 /pp.c | |
parent | 706a6ebcf667fec4e1457b7ad601645a3aaa7764 (diff) | |
download | perl-da9e430b54f7fcb43be1674882e31b92f2aa8253.tar.gz |
[perl #78194] Make x copy PADTMPs in lv cx
So that \(("$a")x2) will give two references to the same scalar, the
way that \(($a)x2) does.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1657,6 +1657,7 @@ PP(pp_repeat) static const char* const oom_list_extend = "Out of memory during list extend"; const I32 items = SP - MARK; const I32 max = items * count; + const U8 mod = PL_op->op_flags & OPf_MOD; MEM_WRAP_CHECK_1(max, SV*, oom_list_extend); /* Did the max computation overflow? */ @@ -1690,7 +1691,11 @@ PP(pp_repeat) } #else if (*SP) + { + if (mod && SvPADTMP(*SP) && !IS_PADGV(*SP)) + *SP = sv_mortalcopy(*SP); SvTEMP_off((*SP)); + } #endif SP--; } |