diff options
author | John Gardiner Myers <jgmyers@proofpoint.com> | 2013-07-29 15:33:09 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2013-07-29 15:33:47 +1000 |
commit | 6136213b81ecb05d74939be5083ddfdc96aef566 (patch) | |
tree | 2095dac9075d771890cbbefc0ff110b5cfbaa885 /perl.c | |
parent | 2e06b51cf21f0d70a782e77099e579ac30d69d3b (diff) | |
download | perl-6136213b81ecb05d74939be5083ddfdc96aef566.tar.gz |
[perl #52000] Warn/abort on attempted perl exit
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -4950,6 +4950,14 @@ void Perl_my_exit(pTHX_ U32 status) { dVAR; + if (PL_exit_flags & PERL_EXIT_ABORT) { + abort(); + } + if (PL_exit_flags & PERL_EXIT_WARN) { + PL_exit_flags |= PERL_EXIT_ABORT; /* Protect against reentrant calls */ + Perl_warn(aTHX_ "Unexpected exit %u", status); + PL_exit_flags &= ~PERL_EXIT_ABORT; + } switch (status) { case 0: STATUS_ALL_SUCCESS; @@ -5047,6 +5055,14 @@ Perl_my_failure_exit(pTHX) STATUS_UNIX_SET(255); } #endif + if (PL_exit_flags & PERL_EXIT_ABORT) { + abort(); + } + if (PL_exit_flags & PERL_EXIT_WARN) { + PL_exit_flags |= PERL_EXIT_ABORT; /* Protect against reentrant calls */ + Perl_warn(aTHX_ "Unexpected exit failure %u", PL_statusvalue); + PL_exit_flags &= ~PERL_EXIT_ABORT; + } my_exit_jump(); } |