This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
S_process_special_blocks() should use a new stack for BEGIN blocks.
authorNicholas Clark <nick@ccl4.org>
Fri, 4 Oct 2013 12:54:00 +0000 (14:54 +0200)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 23 Nov 2013 05:20:37 +0000 (21:20 -0800)
commitebdc88085efa6fca8a1b0afaa388f0491bdccd5a
tree0fc2ec0a57539ba2f808402104996cf800f46eca
parentea35f80112fbe2dfbe7bc30c9804d106145e5241
S_process_special_blocks() should use a new stack for BEGIN blocks.

This avoids the stack moving underneath anything that directly or indirectly
calls Perl_load_module().

[Committer’s note:

 This fixes bug #119993.

 Furthermore, under STRESS_REALLOC, t/io/layers.t was crashing like this:

 $ ./perl -Ilib -e ' open(UTF, "<:raw:encoding(utf8)", 'tmp75851B') or die $!; ref #blahblahblahblahblahblahblahblahblah'
 Segmentation fault: 11

 (The comment seems to be necessary to make it crash.)

 It was happening because open() was causing a module to be loaded
 while the arguments to open() were still on the stack.
]
op.c