summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-06-22 13:34:49 -0500
committerJesse Luehrs <doy@tozt.net>2012-06-23 12:55:55 -0500
commit68b40612054cc4269bdb1112df64c078975b1467 (patch)
treef3ece84172a7c4bf4f0d17df1a0b664c12be3102 /universal.c
parent914077f0095913a3ac75894b4c3610cfa4b30150 (diff)
downloadperl-68b40612054cc4269bdb1112df64c078975b1467.tar.gz
all packages can do methods in UNIVERSAL [perl #47113]
Foo->can("can") should be true even if "package Foo" hasn't been seen yet (obviously, since that method call doesn't die with a method not found error).
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/universal.c b/universal.c
index 384d3071fc..383feaae00 100644
--- a/universal.c
+++ b/universal.c
@@ -369,6 +369,8 @@ XS(XS_UNIVERSAL_can)
}
else {
pkg = gv_stashsv(sv, 0);
+ if (!pkg)
+ pkg = gv_stashpv("UNIVERSAL", 0);
}
if (pkg) {