summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-04-17 12:47:39 +0000
committerNicholas Clark <nick@ccl4.org>2008-04-17 12:47:39 +0000
commiteff494dd14cc5afe1a584bb7e0000a62b81acc19 (patch)
treed8fe8284ac63f47c43d9d4126f903c54e64f778c
parent37698ac13e6c088d690d4d7ee5635c83f340f956 (diff)
downloadperl-eff494dd14cc5afe1a584bb7e0000a62b81acc19.tar.gz
Perl_gv_fetchmethod{,_autoload,_flags} are actually never* called with
a non-NULL stash. So change the parameter to NN. * Fixed the one really obscure hitherto untested case. p4raw-id: //depot/perl@33706
-rw-r--r--embed.fnc7
-rw-r--r--gv.c2
-rw-r--r--pp_sys.c2
-rw-r--r--proto.h9
4 files changed, 12 insertions, 8 deletions
diff --git a/embed.fnc b/embed.fnc
index 49eb9c273a..48bddee9a8 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -297,9 +297,10 @@ Ap |GV* |gv_fetchfile_flags|NN const char *const name|const STRLEN len\
|const U32 flags
Apd |GV* |gv_fetchmeth |NULLOK HV* stash|NN const char* name|STRLEN len|I32 level
Apd |GV* |gv_fetchmeth_autoload |NULLOK HV* stash|NN const char* name|STRLEN len|I32 level
-Apdmb |GV* |gv_fetchmethod |NULLOK HV* stash|NN const char* name
-Apd |GV* |gv_fetchmethod_autoload|NULLOK HV* stash|NN const char* name|I32 autoload
-ApdM |GV* |gv_fetchmethod_flags|NULLOK HV* stash|NN const char* name \
+Apdmb |GV* |gv_fetchmethod |NN HV* stash|NN const char* name
+Apd |GV* |gv_fetchmethod_autoload|NN HV* stash|NN const char* name \
+ |I32 autoload
+ApdM |GV* |gv_fetchmethod_flags|NN HV* stash|NN const char* name \
|U32 flags
Ap |GV* |gv_fetchpv |NN const char *nambeg|I32 add|const svtype sv_type
Ap |void |gv_fullname |NN SV* sv|NN const GV* gv
diff --git a/gv.c b/gv.c
index 5eb09c2458..0b17aec144 100644
--- a/gv.c
+++ b/gv.c
@@ -622,7 +622,7 @@ Perl_gv_fetchmethod_flags(pTHX_ HV *stash, const char *name, U32 flags)
PERL_ARGS_ASSERT_GV_FETCHMETHOD_AUTOLOAD;
- if (stash && SvTYPE(stash) < SVt_PVHV)
+ if (SvTYPE(stash) < SVt_PVHV)
stash = NULL;
for (nend = name; *nend; nend++) {
diff --git a/pp_sys.c b/pp_sys.c
index 98a958dc81..59439e9f17 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -942,7 +942,7 @@ PP(pp_dbmopen)
PUTBACK;
require_pv("AnyDBM_File.pm");
SPAGAIN;
- if (!(gv = gv_fetchmethod(stash, "TIEHASH")))
+ if (!stash || !(gv = gv_fetchmethod(stash, "TIEHASH")))
DIE(aTHX_ "No dbm on this machine");
}
diff --git a/proto.h b/proto.h
index 8d0ae939fb..cba5fa13fd 100644
--- a/proto.h
+++ b/proto.h
@@ -894,19 +894,22 @@ PERL_CALLCONV GV* Perl_gv_fetchmeth_autoload(pTHX_ HV* stash, const char* name,
assert(name)
/* PERL_CALLCONV GV* Perl_gv_fetchmethod(pTHX_ HV* stash, const char* name)
+ __attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2); */
#define PERL_ARGS_ASSERT_GV_FETCHMETHOD \
- assert(name)
+ assert(stash); assert(name)
PERL_CALLCONV GV* Perl_gv_fetchmethod_autoload(pTHX_ HV* stash, const char* name, I32 autoload)
+ __attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);
#define PERL_ARGS_ASSERT_GV_FETCHMETHOD_AUTOLOAD \
- assert(name)
+ assert(stash); assert(name)
PERL_CALLCONV GV* Perl_gv_fetchmethod_flags(pTHX_ HV* stash, const char* name, U32 flags)
+ __attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);
#define PERL_ARGS_ASSERT_GV_FETCHMETHOD_FLAGS \
- assert(name)
+ assert(stash); assert(name)
PERL_CALLCONV GV* Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, const svtype sv_type)
__attribute__nonnull__(pTHX_1);