From a373464fd655c7246cf689f421efc503307b705c Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 24 Oct 2013 05:41:17 -0700 Subject: Fix bare blocks in lvalue subs If a bare block is the last thing in an lvalue sub, OP_LEAVELOOP needs to propagate lvalue context and handle returned arrays properly, just as OP_LEAVE has done since yesterday. This is a follow-up to 2ec7f6f24289. This came up in ticket #119797. --- pp_ctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pp_ctl.c') diff --git a/pp_ctl.c b/pp_ctl.c index 4be2b194f9..c3b66bb01a 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -2277,7 +2277,8 @@ PP(pp_leaveloop) newsp = PL_stack_base + cx->blk_loop.resetsp; TAINT_NOT; - SP = adjust_stack_on_leave(newsp, SP, MARK, gimme, 0, FALSE); + SP = adjust_stack_on_leave(newsp, SP, MARK, gimme, 0, + PL_op->op_private & OPpLVALUE); PUTBACK; POPLOOP(cx); /* Stack values are safe: release loop vars ... */ -- cgit v1.2.1