[Bast-commits] r9758 - in Class-Accessor-Grouped/trunk: .
lib/Class/Accessor t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Mon Oct 11 07:34:48 GMT 2010
Author: ribasushi
Date: 2010-10-11 08:34:48 +0100 (Mon, 11 Oct 2010)
New Revision: 9758
Modified:
Class-Accessor-Grouped/trunk/Changes
Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm
Class-Accessor-Grouped/trunk/t/accessors_xs.t
Log:
Backcompat is tough business :)
Modified: Class-Accessor-Grouped/trunk/Changes
===================================================================
--- Class-Accessor-Grouped/trunk/Changes 2010-10-09 10:28:45 UTC (rev 9757)
+++ Class-Accessor-Grouped/trunk/Changes 2010-10-11 07:34:48 UTC (rev 9758)
@@ -1,5 +1,7 @@
Revision history for Class::Accessor::Grouped.
+ - Fix corner case segfaults with C::XSA and old 5.8 perls
+
0.09007 Sat Oct 9 10:22:56 2010
- Fix corner case when get/set_simple overrides are circumvented
iff Class::XSAccessor is present
Modified: Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm
===================================================================
--- Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm 2010-10-09 10:28:45 UTC (rev 9757)
+++ Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm 2010-10-11 07:34:48 UTC (rev 9758)
@@ -129,6 +129,10 @@
*$fq_meth = Sub::Name::subname($fq_meth, $final_cref);
+ # older perls segfault if the cref behind the goto throws
+ # http://rt.perl.org/rt3/Public/Bug/Display.html?id=35878
+ return $final_cref->(@_) if ($] < 5.008009);
+
goto $final_cref;
};
};
Modified: Class-Accessor-Grouped/trunk/t/accessors_xs.t
===================================================================
--- Class-Accessor-Grouped/trunk/t/accessors_xs.t 2010-10-09 10:28:45 UTC (rev 9757)
+++ Class-Accessor-Grouped/trunk/t/accessors_xs.t 2010-10-11 07:34:48 UTC (rev 9758)
@@ -2,6 +2,7 @@
use warnings;
use FindBin qw($Bin);
use File::Spec::Functions;
+use File::Spec::Unix (); # need this for %INC munging
use Test::More;
use lib 't/lib';
@@ -18,8 +19,21 @@
# rerun the regular 3 tests under XSAccessor
$Class::Accessor::Grouped::USE_XS = 1;
-for (qw/accessors.t accessors_ro.t accessors_wo.t/) {
- subtest "$_ with USE_XS" => sub { require( catfile($Bin, $_) ) }
+for my $tname (qw/accessors.t accessors_ro.t accessors_wo.t/) {
+
+ subtest "$tname with USE_XS (pass $_)" => sub {
+ my $tfn = catfile($Bin, $tname);
+
+ delete $INC{$_} for (
+ qw/AccessorGroups.pm AccessorGroupsRO.pm AccessorGroupsSubclass.pm AccessorGroupsWO.pm/,
+ File::Spec::Unix->catfile ($tfn),
+ );
+
+ local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /subroutine .+ redefined/i };
+
+ do($tfn);
+
+ } for (1 .. 2);
}
done_testing;
More information about the Bast-commits
mailing list