[George Hartlieb, a MLDBM user reported this problem in private mail.]
The following hypothetical construct:
for $k (keys %o) {
foo([$o{$k}]);
}
coredumps reliably when %o is a tied hash and the FETCH for the
value $o{$k} is substantial enough to cause a stack reallocation.
Patch against 3_19 attached.
- Sarathy.
gsar@engin.umich.edu
P.S: Whatever happened to the stack-of-stacks patch? Even the first
version of that patch would have eliminated this problem. There may
be many more places where such a fix may be necessary--it's impossible
to find them all. Please, let's atleast include a #ifdef-ed version
of that patch!
p5p-msgid: <
199701100745.CAA13057@aatma.engin.umich.edu>
PP(pp_anonlist)
{
- dSP; dMARK;
+ dSP; dMARK; dORIGMARK;
I32 items = SP - MARK;
- SP = MARK;
- XPUSHs((SV*)sv_2mortal((SV*)av_make(items, MARK+1)));
+ SV *av = sv_2mortal((SV*)av_make(items, MARK+1));
+ SP = ORIGMARK; /* av_make() might realloc stack_sp */
+ XPUSHs(av);
RETURN;
}