From: Nicholas Clark Date: Sun, 2 May 2010 20:04:32 +0000 (+0100) Subject: Permit array assignment to steal temps and copy shared hash key scalars. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f0556e9541e0e65f0abc5f4f6caf1f16ddf2dcd;p=p5sagit%2Fp5-mst-13.2.git Permit array assignment to steal temps and copy shared hash key scalars. Scalar assignment to array elements already does this. (As does all other scalar assignment, and list assignment to hashes.) Prior to 4c8f17b905f2 (change 7867) list assignment to arrays did steal temps. --- diff --git a/pp_hot.c b/pp_hot.c index 95a6822..ea949b8 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1037,7 +1037,8 @@ PP(pp_aassign) while (relem <= lastrelem) { /* gobble up all the rest */ SV **didstore; assert(*relem); - sv = newSVsv(*relem); + sv = newSV(0); + sv_setsv(sv, *relem); *(relem++) = sv; didstore = av_store(ary,i++,sv); if (magic) {