diff options
Diffstat (limited to 'lang/perl5.16/files/patch-bug71952')
-rw-r--r-- | lang/perl5.16/files/patch-bug71952 | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lang/perl5.16/files/patch-bug71952 b/lang/perl5.16/files/patch-bug71952 new file mode 100644 index 000000000000..c36c7d721edb --- /dev/null +++ b/lang/perl5.16/files/patch-bug71952 @@ -0,0 +1,46 @@ +# http://rt.perl.org/rt3/Public/Bug/Display.html?id=71952 +# http://perl5.git.perl.org/perl.git/commitdiff_plain/1f15e670edb515b744e9021b4a42a7955da83093?hp=1f730e6c11736bad913e605b064200a67117e898 +diff --git a/sv.c b/sv.c +index 4e80e18..a3eb187 100644 +--- sv.c ++++ sv.c +@@ -5664,7 +5664,8 @@ Perl_sv_clear(pTHX_ register SV *const sv) + && !CvCONST(destructor) + /* Don't bother calling an empty destructor */ + && (CvISXSUB(destructor) +- || CvSTART(destructor)->op_next->op_type != OP_LEAVESUB)) ++ || (CvSTART(destructor) ++ && (CvSTART(destructor)->op_next->op_type != OP_LEAVESUB)))) + { + SV* const tmpref = newRV(sv); + SvREADONLY_on(tmpref); /* DESTROY() could be naughty */ +diff --git a/t/op/method.t b/t/op/method.t +index afa8cfb..b602ca2 100644 +--- t/op/method.t ++++ 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" ++ ); ++} ++ |