Change 34012 by [EMAIL PROTECTED] on 2008/06/07 15:02:39
Integrate:
[ 33955]
Integrate:
...
[ 33937]
[perl #54758] Perl 5.10 memory corruption
When @a = sort @a is pessimised if @a has magic,
growing the stack requires various pointers to be reset in case
the stack gets reallocated.
...
Affected files ...
... //depot/maint-5.8/perl/pp_sort.c#50 integrate
Differences ...
==== //depot/maint-5.8/perl/pp_sort.c#50 (text) ====
Index: perl/pp_sort.c
--- perl/pp_sort.c#49~30927~ 2007-04-12 08:03:57.000000000 -0700
+++ perl/pp_sort.c 2008-06-07 08:02:39.000000000 -0700
@@ -1548,11 +1548,12 @@
max = AvFILL(av) + 1;
if (SvMAGICAL(av)) {
MEXTEND(SP, max);
- p2 = SP;
for (i=0; i < max; i++) {
SV **svp = av_fetch(av, i, FALSE);
*SP++ = (svp) ? *svp : NULL;
}
+ SP--;
+ p1 = p2 = SP - (max-1);
}
else {
if (SvREADONLY(av))
@@ -1716,7 +1717,7 @@
SvREADONLY_off(av);
else if (av && !sorting_av) {
/* simulate pp_aassign of tied AV */
- SV** const base = ORIGMARK+1;
+ SV** const base = MARK+1;
for (i=0; i < max; i++) {
base[i] = newSVsv(base[i]);
}
End of Patch.