summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2001-11-22 03:42:58 +0000
committerGurusamy Sarathy <gsar@cpan.org>2001-11-22 03:42:58 +0000
commitb9f751c0c83936edb2414f3db711d9aed06f58af (patch)
treefe0107b35aa5f11f92206aa04d5359617ae0bed1 /op.c
parent72c157b023d430ca1a19cb152e889432a114232b (diff)
downloadperl-b9f751c0c83936edb2414f3db711d9aed06f58af.tar.gz
local(*CORE::GLOBAL::require) doesn't behave like other overrides
p4raw-id: //depot/perl@13187
Diffstat (limited to 'op.c')
-rw-r--r--op.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/op.c b/op.c
index 6343a03578..edd1ad2451 100644
--- a/op.c
+++ b/op.c
@@ -3431,10 +3431,10 @@ Perl_dofile(pTHX_ OP *term)
GV *gv;
gv = gv_fetchpv("do", FALSE, SVt_PVCV);
- if (!(gv && GvIMPORTED_CV(gv)))
+ if (!(gv && GvCVu(gv) && GvIMPORTED_CV(gv)))
gv = gv_fetchpv("CORE::GLOBAL::do", FALSE, SVt_PVCV);
- if (gv && GvIMPORTED_CV(gv)) {
+ if (gv && GvCVu(gv) && GvIMPORTED_CV(gv)) {
doop = ck_subr(newUNOP(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST, term,
scalar(newUNOP(OP_RV2CV, 0,
@@ -5929,8 +5929,11 @@ Perl_ck_glob(pTHX_ OP *o)
if ((o->op_flags & OPf_KIDS) && !cLISTOPo->op_first->op_sibling)
append_elem(OP_GLOB, o, newDEFSVOP());
- if (!((gv = gv_fetchpv("glob", FALSE, SVt_PVCV)) && GvIMPORTED_CV(gv)))
+ if (!((gv = gv_fetchpv("glob", FALSE, SVt_PVCV))
+ && GvCVu(gv) && GvIMPORTED_CV(gv)))
+ {
gv = gv_fetchpv("CORE::GLOBAL::glob", FALSE, SVt_PVCV);
+ }
#if !defined(PERL_EXTERNAL_GLOB)
/* XXX this can be tightened up and made more failsafe. */
@@ -5948,7 +5951,7 @@ Perl_ck_glob(pTHX_ OP *o)
}
#endif /* PERL_EXTERNAL_GLOB */
- if (gv && GvIMPORTED_CV(gv)) {
+ if (gv && GvCVu(gv) && GvIMPORTED_CV(gv)) {
append_elem(OP_GLOB, o,
newSVOP(OP_CONST, 0, newSViv(PL_glob_index++)));
o->op_type = OP_LIST;
@@ -6259,10 +6262,10 @@ Perl_ck_require(pTHX_ OP *o)
/* handle override, if any */
gv = gv_fetchpv("require", FALSE, SVt_PVCV);
- if (!(gv && GvIMPORTED_CV(gv)))
+ if (!(gv && GvCVu(gv) && GvIMPORTED_CV(gv)))
gv = gv_fetchpv("CORE::GLOBAL::require", FALSE, SVt_PVCV);
- if (gv && GvIMPORTED_CV(gv)) {
+ if (gv && GvCVu(gv) && GvIMPORTED_CV(gv)) {
OP *kid = cUNOPo->op_first;
cUNOPo->op_first = 0;
op_free(o);