This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix SEGVs and test failures for -DPERL_GLOBAL_STRUCT_PRIVATE
authorNicholas Clark <nick@ccl4.org>
Wed, 26 Jun 2013 16:01:09 +0000 (18:01 +0200)
committerNicholas Clark <nick@ccl4.org>
Fri, 12 Jul 2013 10:51:39 +0000 (12:51 +0200)
commit5c64bffd0d9c35e88b9ac48fc997977163abcc50
treeb6caa55fa3e482170bf8f3304e96de6a9937b7f4
parent358c04b72260b75d5a00491f60fc675c4790fe11
Fix SEGVs and test failures for -DPERL_GLOBAL_STRUCT_PRIVATE

With PERL_GLOBAL_STRUCT_PRIVATE "global" variables are in a structure in
malloc()ed memory, not in global static variables or a global static
structure. Hence no global variables are implicitly initialised to zero.

* PL_curinterp and PL_op_sequence need initialising to NULL
* The global structure is free()d before handlers registered with atexit()
  run, so be defensive about this.
* Some C code checks SvOK(PL_sv_placeholder) so ensure that its SvFLAGS()
  are 0.
* Zero PL_hash_seed
ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
lib/ExtUtils/t/Embed.t
miniperlmain.c
perl.c
perlvars.h
util.c