diff options
author | Reini Urban <rurban@cpanel.net> | 2015-04-23 13:04:05 +0200 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2015-06-10 09:49:40 +1000 |
commit | 4221d7c5eb104778a9335f0f89b12f122d99e425 (patch) | |
tree | 85441f8838ae488ab54ffd38b527f65a8cc3706a | |
parent | 724fb20655e1cbd6e734c7bc2f8ad1c8e1d40c39 (diff) | |
download | perl-4221d7c5eb104778a9335f0f89b12f122d99e425.tar.gz |
add warnings 7fatal testcase for #123398
-rw-r--r-- | t/lib/warnings/7fatal | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/lib/warnings/7fatal b/t/lib/warnings/7fatal index 87f3fd0040..40c649f249 100644 --- a/t/lib/warnings/7fatal +++ b/t/lib/warnings/7fatal @@ -548,3 +548,21 @@ syntax error at - line 4, near "1 {" "my" variable $x masks earlier declaration in same statement at - line 6. syntax error at - line 7, near "}" Execution of - aborted due to compilation errors. +######## + +# fatal warnings in DESTROY should be made non-fatal [perl #123398] +# This test will blow up your memory with SEGV without the patch +package Foo; +use strict; use utf8; use warnings FATAL => 'all'; +sub new { + return bless{ 'field' => undef }, 'Foo'; +} +sub DESTROY { + my $self = shift; + $self->{'field'}->missing_method; +} +package main; +my $foo = new Foo; +undef($foo); +EXPECT + (in cleanup) Can't call method "missing_method" on an undefined value at - line 11. |