From: Shawn M Moore Date: Mon, 29 Sep 2008 02:25:57 +0000 (+0000) Subject: Resolve #39001: Call a method on the class after setting the superclass list so that... X-Git-Tag: 0.67~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2e7eb96b19fab4284375fd63541ae96d15ed3cf8;p=gitmo%2FClass-MOP.git Resolve #39001: Call a method on the class after setting the superclass list so that we can get Perl to detect cycles before MRO::Compat spirals into an infinite loop --- diff --git a/Changes b/Changes index e319484..a537bfc 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,12 @@ Revision history for Perl extension Class-MOP. +0.67 + * Class::MOP::Class + - Call a method on the class after setting the superclass list + so that we can get Perl to detect cycles before MRO::Compat + spirals into an infinite loop (sartak) + - Reported by Schwern, [rt.cpan.org #39001] + 0.66 !! This release has an incompatible change regarding !! introspection of a class's method with Class::MOP::Class !! diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index cc57b6c..59baa88 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -500,6 +500,14 @@ sub superclasses { if (@_) { my @supers = @_; @{$self->get_package_symbol($var_spec)} = @supers; + + # NOTE: + # on 5.8 and below, we need to call + # a method to get Perl to detect + # a cycle in the class hierarchy + my $class = $self->name; + $class->isa($class); + # NOTE: # we need to check the metaclass # compatibility here so that we can