diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-11-20 20:39:56 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-11-22 21:20:37 -0800 |
commit | 865e3ae09bd2dde9953a008963d3c5a0ad14e32d (patch) | |
tree | 561da0ed53edbfa8fa507bff4ae30331115ad08e /av.c | |
parent | 0ff725582ada84044c87936ed5498addbfbb2a5a (diff) | |
download | perl-865e3ae09bd2dde9953a008963d3c5a0ad14e32d.tar.gz |
Extend STRESS_REALLOC to move the stack with every EXTEND
This allows us easily to catch cases where the stack could move to a
new memory address while code still holds pointers to the old loca-
tion. Indeed, this causes test failures.
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -143,7 +143,16 @@ Perl_av_extend_guts(pTHX_ AV *av, SSize_t key, SSize_t *maxp, SV ***allocp, #endif MEM_WRAP_CHECK_1(newmax+1, SV*, oom_array_extend); } +#ifdef STRESS_REALLOC + { + SV ** const old_alloc = *allocp; + Newx(*allocp, newmax+1, SV*); + Copy(old_alloc, *allocp, *maxp + 1, SV*); + Safefree(old_alloc); + } +#else Renew(*allocp,newmax+1, SV*); +#endif #ifdef Perl_safesysmalloc_size resized: #endif |