summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-01-02 23:00:53 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-01-02 23:48:23 -0800
commit884491dbe6aed1876e8cb44f8371e6feb3302ce8 (patch)
tree31b49e5bb915dc81649015e23cda77c52ab7e476
parent54a4274e3c68e0e5bc9baaef00b55c43097929a7 (diff)
downloadperl-884491dbe6aed1876e8cb44f8371e6feb3302ce8.tar.gz
Revert "[perl #80098] Bleadperl breaks Attribute::Lexical"
This reverts commit 1726bc11330f7a943b1e12c6dd5fa5454b90abd6.
-rw-r--r--ext/mro/mro.xs15
-rw-r--r--t/mro/next_edgecases.t16
2 files changed, 9 insertions, 22 deletions
diff --git a/ext/mro/mro.xs b/ext/mro/mro.xs
index acccdd5a3d..63befa9d23 100644
--- a/ext/mro/mro.xs
+++ b/ext/mro/mro.xs
@@ -482,7 +482,7 @@ mro__nextcan(...)
const char *hvname;
I32 entries;
struct mro_meta* selfmeta;
- bool searching_univ = FALSE;
+ bool seen_univ = FALSE;
HV* nmcache;
I32 i;
PPCODE:
@@ -633,7 +633,9 @@ mro__nextcan(...)
assert(curstash);
- if (searching_univ && curstash == selfstash) break;
+ if (!seen_univ && SvCUR(linear_sv) == 9
+ && strnEQ(SvPV_nolen_const(linear_sv), "UNIVERSAL", 9))
+ seen_univ = TRUE;
gvp = (GV**)hv_fetch(curstash, subname, subname_len, 0);
if (!gvp) continue;
@@ -656,15 +658,12 @@ mro__nextcan(...)
}
}
- if (!searching_univ) {
- HV * const unistash = gv_stashpvn("UNIVERSAL", 9, 0);
- if (unistash) {
- linear_av = S_mro_get_linear_isa_c3(aTHX_ unistash, 0);
+ if (!seen_univ && (selfstash = gv_stashpvn("UNIVERSAL", 9, 0))) {
+ linear_av = S_mro_get_linear_isa_c3(aTHX_ selfstash, 0);
linear_svp = AvARRAY(linear_av);
entries = AvFILLp(linear_av) + 1;
- searching_univ = TRUE;
+ seen_univ = TRUE;
goto retry;
- }
}
(void)hv_store_ent(nmcache, sv, &PL_sv_undef, 0);
diff --git a/t/mro/next_edgecases.t b/t/mro/next_edgecases.t
index 3840a4b882..e77ce7be31 100644
--- a/t/mro/next_edgecases.t
+++ b/t/mro/next_edgecases.t
@@ -5,7 +5,7 @@ use warnings;
BEGIN { chdir 't'; require q(./test.pl); @INC = qw "../lib lib" }
-plan(tests => 17);
+plan(tests => 14);
{
@@ -94,15 +94,13 @@ plan(tests => 17);
}
-# Test next::method/can with UNIVERSAL methods
+# Test next::method with UNIVERSAL methods
{
package UNIVERSAL;
sub foo { "foo" }
- sub kan { shift->next::can }
our @ISA = "a";
package a;
sub bar { "bar" }
- sub baz { shift->next::can }
package M;
sub foo { shift->next::method }
sub bar { shift->next::method }
@@ -110,14 +108,4 @@ plan(tests => 17);
is eval { M->foo }, "foo", 'next::method with implicit UNIVERSAL';
is eval { M->bar }, "bar", 'n::m w/superclass of implicit UNIVERSAL';
-
- is baz a, undef,
- 'univ superclasses next::cannot their own methods';
- is kan UNIVERSAL, undef,
- 'UNIVERSAL next::cannot its own methods';
-
- @a::ISA = 'b';
- sub b::cnadd { shift->next::can }
- is baz b, \&a::baz,
- 'univ supersuperclass noxt::can method in its immediate subclasses';
}