6255bf69e0
- Update P5PORTER mode [3] - Update CONFLICTS for Perl 5.12 Pointed by: a.smith xx ukgrid.net [1] PR: ports/144717 [2], ports/142110 [3] Submitted by: Bryan Fullerton <bryanf@samuraiconsulting.ca> [2], Alex Deiter <alex.deiter xx gmail.com> [3]
46 lines
1.3 KiB
Text
46 lines
1.3 KiB
Text
# 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"
|
|
+ );
|
|
+}
|
|
+
|