summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2002-10-30 12:58:15 -0800
committerhv <hv@crypt.org>2002-11-19 11:48:30 +0000
commit0dae17bd7971d11b90a07b6fc03ec78ab38e4db4 (patch)
treebb9953708a3910f44e857da188d9d76096cc4231 /pp_hot.c
parent8af2e859c733a1615cc8dbeb3491332ed702a779 (diff)
downloadperl-0dae17bd7971d11b90a07b6fc03ec78ab38e4db4.tar.gz
Re: [perl #18113] UNIVERSAL::AUTOLOAD doesn't work if the stash doesn't exist yet
Date: Wed, 30 Oct 2002 20:58:15 -0800 Message-Id: <200210310458.g9V4wFK00513@smtp3.ActiveState.com> Date: Wed, 30 Oct 2002 21:56:22 -0800 Message-Id: <200210310556.g9V5uMK05748@smtp3.ActiveState.com> Date: Wed, 30 Oct 2002 22:55:30 -0800 Message-Id: <200210310655.g9V6tUK10959@smtp3.ActiveState.com> p4raw-id: //depot/perl@18159
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index f4ca5f3d8b..0b3d6228c3 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2820,6 +2820,7 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
char* name;
STRLEN namelen;
char* packname = 0;
+ SV *packsv = Nullsv;
STRLEN packlen;
name = SvPV(meth, namelen);
@@ -2855,6 +2856,8 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
}
/* assume it's a package name */
stash = gv_stashpvn(packname, packlen, FALSE);
+ if (!stash)
+ packsv = sv;
goto fetch;
}
/* it _is_ a filehandle name -- replace with a reference */
@@ -2887,7 +2890,7 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
}
}
- gv = gv_fetchmethod(stash, name);
+ gv = gv_fetchmethod(stash ? stash : (HV*)packsv, name);
if (!gv) {
/* This code tries to figure out just what went wrong with