New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overload::Method can die with blessed methods #10071
Comments
From @cpansproutIf an overload method is itself blessed into a class that has $ perl5.10.0 The attached patch fixes this. Flags: This perlbug was built using Perl v5.8.8 - Sun Sep 23 19:05:56 PDT 2007 Site configuration information for perl v5.10.0: Configured by sprout at Sat Nov 10 00:26:07 PST 2007. Summary of my perl5 (revision 5 version 10 subversion 0 patch 32262) Locally applied patches: @INC for perl v5.10.0: Environment for perl v5.10.0: |
From @cpansproutInline Patchdiff -Nurp blead/lib/overload.pm blead-overload-Method/lib/overload.pm
--- blead/lib/overload.pm 2009-11-19 08:51:38.000000000 -0800
+++ blead-overload-Method/lib/overload.pm 2010-01-08 20:22:12.000000000 -0800
@@ -57,7 +57,9 @@ sub ov_method {
my $globref = shift;
return undef unless $globref;
my $sub = \&{*$globref};
- return $sub if $sub ne \&nil;
+ require Scalar::Util;
+ return $sub
+ if Scalar::Util::refaddr($sub) != Scalar::Util::refaddr(\&nil);
return shift->can($ {*$globref});
}
diff -Nurp blead/lib/overload.t blead-overload-Method/lib/overload.t
--- blead/lib/overload.t 2009-12-14 06:36:09.000000000 -0800
+++ blead-overload-Method/lib/overload.t 2010-01-08 20:23:19.000000000 -0800
@@ -47,7 +47,7 @@ sub numify { 0 + "${$_[0]}" } # Not need
package main;
$| = 1;
-use Test::More tests => 607;
+use Test::More tests => 608;
$a = new Oscalar "087";
@@ -1590,4 +1590,12 @@ foreach my $op (qw(<=> == != < <= > >=))
is($y, $o, "copy constructor falls back to assignment (preinc)");
}
+{
+ package blessed_methods;
+ use overload '+' => sub {};
+ bless overload::Method __PACKAGE__,'+';
+ eval { overload::Method __PACKAGE__,'+' };
+ ::is($@, '', 'overload::Method and blessed overload methods');
+}
+
# EOF |
From @cpansproutOn Sun Jan 10 13:41:49 2010, sprout wrote:
Applied as 56f08af. |
From [Unknown Contact. See original ticket]On Sun Jan 10 13:41:49 2010, sprout wrote:
Applied as 56f08af. |
@cpansprout - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#71998 (status was 'resolved')
Searchable as RT71998$
The text was updated successfully, but these errors were encountered: