summaryrefslogtreecommitdiff
path: root/pp_sort.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-09-20 10:23:35 +0200
committerRafael Garcia-Suarez <rgs@consttype.org>2010-09-20 10:23:35 +0200
commit8e7d0c4b4f9a32461518a61c3643c060cadc7b52 (patch)
tree2e49ff3dde1787a6d60bb94406f2c624b70ca914 /pp_sort.c
parent65efc2f779afe1f849b3400dfd17c33f7f829604 (diff)
downloadperl-8e7d0c4b4f9a32461518a61c3643c060cadc7b52.tar.gz
[perl #77930] cx_stack reallocation during sort
Reset cx in pp_sort before POPSUB, as the pointer may no longer be valid.
Diffstat (limited to 'pp_sort.c')
-rw-r--r--pp_sort.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pp_sort.c b/pp_sort.c
index f1ec82aec2..f96d5682f9 100644
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1679,6 +1679,9 @@ PP(pp_sort)
if (!(flags & OPf_SPECIAL)) {
SV *sv;
+ /* Reset cx, in case the context stack has been
+ reallocated. */
+ cx = &cxstack[cxstack_ix];
POPSUB(cx, sv);
LEAVESUB(sv);
}