From: Nicholas Clark Date: Sat, 22 Dec 2007 12:50:35 +0000 (+0000) Subject: Correct the minor mistake of changes 32675 and 32676 - the check should X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=64484faa0be51485f76b4a5e1542b1fe76c13a76;p=p5sagit%2Fp5-mst-13.2.git Correct the minor mistake of changes 32675 and 32676 - the check should be on whether the SV had a body before upgrading. As was, SVt_RV would needlessly have re-zeroed memory. p4raw-id: //depot/perl@32701 --- diff --git a/sv.c b/sv.c index 8dfd3ac..72b64b6 100644 --- a/sv.c +++ b/sv.c @@ -1253,7 +1253,7 @@ Perl_sv_upgrade(pTHX_ register SV *sv, svtype new_type) AvMAX(sv) = -1; AvFILLp(sv) = -1; AvREAL_only(sv); - if (old_type >= SVt_RV) { + if (old_type_details->body_size) { AvALLOC(sv) = 0; } else { /* It will have been zeroed when the new body was allocated. @@ -1267,7 +1267,7 @@ Perl_sv_upgrade(pTHX_ register SV *sv, svtype new_type) HvSHAREKEYS_on(sv); /* key-sharing on by default */ #endif HvMAX(sv) = 7; /* (start with 8 buckets) */ - if (old_type >= SVt_RV) { + if (old_type_details->body_size) { HvFILL(sv) = 0; } else { /* It will have been zeroed when the new body was allocated.