summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-11-13 07:45:35 +0000
committerZefram <zefram@fysh.org>2017-11-13 07:45:35 +0000
commite8b20b1238fb2bfcdc6d131e979cbd6c1dbd4b71 (patch)
tree7cd5cdabfa8ddfdb0872efd42c3377d1c2c83856 /sv.c
parentf63f40368cca0cfffd2773a6206d1ab3235b61b3 (diff)
downloadperl-e8b20b1238fb2bfcdc6d131e979cbd6c1dbd4b71.tar.gz
duplicate full index for SAVEt_AELEM
The index in a SAVEt_AELEM save entry is now IV-sized, but only an I32 portion of it was being duplicated. This would lead to restoring the wrong element if a pseudfork were done with a localised array element on the stack, if the array index were above the 32-bit range or on a big-endian architecture.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index c1a33fb0a0..e39f44a035 100644
--- a/sv.c
+++ b/sv.c
@@ -14974,8 +14974,8 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
case SAVEt_AELEM: /* array element */
sv = (const SV *)POPPTR(ss,ix);
TOPPTR(nss,ix) = SvREFCNT_inc(sv_dup_inc(sv, param));
- i = POPINT(ss,ix);
- TOPINT(nss,ix) = i;
+ iv = POPIV(ss,ix);
+ TOPIV(nss,ix) = iv;
av = (const AV *)POPPTR(ss,ix);
TOPPTR(nss,ix) = av_dup_inc(av, param);
break;