summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@debian.org>2010-01-19 11:03:08 +0100
committerSteffen Mueller <smueller@cpan.org>2010-01-19 11:04:29 +0100
commit1f15e670edb515b744e9021b4a42a7955da83093 (patch)
tree748d606ce4c3db5cebc6f0be851b6b33e6044ee6 /t
parent1f730e6c11736bad913e605b064200a67117e898 (diff)
downloadperl-1f15e670edb515b744e9021b4a42a7955da83093.tar.gz
Fix a NULL pointer dereference when looking for a DESTROY method
The empty DESTROY method optimization introduced by commit fbb3ee5af3d would crash the interpreter if a DESTROY method was declared but not actually defined. This is seen in the real world with AutoLoader / AutoSplit, where the crash defeats autoloading a DESTROY method.
Diffstat (limited to 't')
-rw-r--r--t/op/method.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/op/method.t b/t/op/method.t
index afa8cfbb2a..b602ca220b 100644
--- a/t/op/method.t
+++ b/t/op/method.t
@@ -10,7 +10,7 @@ BEGIN {
require "test.pl";
}
-print "1..78\n";
+print "1..79\n";
@A::ISA = 'B';
@B::ISA = 'C';
@@ -292,3 +292,16 @@ EOT
"check if UNIVERSAL::AUTOLOAD works",
);
}
+
+# Test for #71952: crash when looking for a nonexistent destructor
+# Regression introduced by fbb3ee5af3d4
+{
+ fresh_perl_is(<<'EOT',
+sub M::DESTROY; bless {}, "M" ; print "survived\n";
+EOT
+ "survived",
+ {},
+ "no crash with a declared but missing DESTROY method"
+ );
+}
+