Correct the minor mistake of changes 32675 and 32676 - the check should
authorNicholas Clark <nick@ccl4.org>
Sat, 22 Dec 2007 12:50:35 +0000 (12:50 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 22 Dec 2007 12:50:35 +0000 (12:50 +0000)
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

sv.c

diff --git a/sv.c b/sv.c
index 8dfd3ac..72b64b6 100644 (file)
--- 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.