Release 0.09008
[p5sagit/Class-Accessor-Grouped.git] / lib / Class / Accessor / Grouped.pm
index 0bb627b..ad19c62 100644 (file)
@@ -6,7 +6,7 @@ use Scalar::Util ();
 use MRO::Compat;
 use Sub::Name ();
 
-our $VERSION = '0.09007';
+our $VERSION = '0.09008';
 $VERSION = eval $VERSION;
 
 # when changing minimum version don't forget to adjust L</PERFROMANCE> as well
@@ -129,11 +129,19 @@ my $add_xs_accessor = sub {
 
         *$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;
     };
 };
 
-my $install_group_accessors = sub {
+# Yes this method is undocumented
+# Yes it should be a private coderef like the one above it
+# No we can't do that (yet) because the DBIC-CDBI compat layer overrides it
+# %$*@!?&!&#*$!!!
+sub _mk_group_accessors {
     my($self, $maker, $group, @fields) = @_;
     my $class = Scalar::Util::blessed $self || $self;
 
@@ -213,7 +221,7 @@ be of the form [ $accessor, $field ].
 sub mk_group_accessors {
   my ($self, $group, @fields) = @_;
 
-  $self->$install_group_accessors('make_group_accessor', $group, @fields);
+  $self->_mk_group_accessors('make_group_accessor', $group, @fields);
   return;
 }
 
@@ -236,7 +244,7 @@ rather than setting the value.
 sub mk_group_ro_accessors {
     my($self, $group, @fields) = @_;
 
-    $self->$install_group_accessors('make_group_ro_accessor', $group, @fields);
+    $self->_mk_group_accessors('make_group_ro_accessor', $group, @fields);
 }
 
 =head2 mk_group_wo_accessors
@@ -258,7 +266,7 @@ value rather than getting the value.
 sub mk_group_wo_accessors {
     my($self, $group, @fields) = @_;
 
-    $self->$install_group_accessors('make_group_wo_accessor', $group, @fields);
+    $self->_mk_group_accessors('make_group_wo_accessor', $group, @fields);
 }
 
 =head2 make_group_accessor