summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index 718e305646..eaaa7260b9 100644
--- a/sv.c
+++ b/sv.c
@@ -1253,6 +1253,13 @@ Perl_sv_upgrade(pTHX_ register SV *sv, svtype new_type)
AvMAX(sv) = -1;
AvFILLp(sv) = -1;
AvREAL_only(sv);
+ if (old_type >= SVt_RV) {
+ AvALLOC(sv) = 0;
+ } else {
+ /* It will have been zeroed when the new body was allocated.
+ Lets not write to it, in case it confuses a write-back
+ cache. */
+ }
}
/* SVt_NULL isn't the only thing upgraded to AV or HV.