summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2015-04-14 15:59:03 +1000
committerSteve Hay <steve.m.hay@googlemail.com>2015-08-10 08:41:30 +0100
commit4db4d6727189105b033a1a4be009711535cd7407 (patch)
treeddbd1aedd8594c319b3d4b1fc4f040429eb019ce /sv.c
parent6410499c3576275d529c1c5db34622340e6531ef (diff)
downloadperl-4db4d6727189105b033a1a4be009711535cd7407.tar.gz
[perl #124127] fix cloning arrays with unused elements
ce0d59fd changed arrays to use NULL instead of &PL_sv_undef for unused elements, unfortunately it missed updating sv_dup_common()'s initialization of unused elements, leaving them as &PL_sv_undef. This resulted in modification of read only value errors at runtime. (cherry picked from commit 902d16915db2735c3a41f15ef8d95cf300c31801)
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index af393bdeab..06db7d9b2c 100644
--- a/sv.c
+++ b/sv.c
@@ -12698,7 +12698,7 @@ S_sv_dup_common(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
}
items = AvMAX((const AV *)sstr) - AvFILLp((const AV *)sstr);
while (items-- > 0) {
- *dst_ary++ = &PL_sv_undef;
+ *dst_ary++ = NULL;
}
}
else {