summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-02-12 13:15:20 +0000
committerNicholas Clark <nick@ccl4.org>2008-02-12 13:15:20 +0000
commit7918f24d20384771923d344a382e1d16d9552018 (patch)
tree627e24f3c520f70ddfd3fc9779420bd72fd00c55 /universal.c
parent9f10164a6c9d93684fedbbc188fb9dfe004c22c4 (diff)
downloadperl-7918f24d20384771923d344a382e1d16d9552018.tar.gz
assert() that every NN argument is not NULL. Otherwise we have the
ability to create landmines that will explode under someone in the future when they upgrade their compiler to one with better optimisation. We've already done this at least twice. (Yes, some of the assertions are after code that would already have SEGVd because it already deferences a pointer, but they are put in to make it easier to automate checking that each and every case is covered.) Add a tool, checkARGS_ASSERT.pl, to check that every case is covered. p4raw-id: //depot/perl@33291
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/universal.c b/universal.c
index ce73c823cc..d03596c82b 100644
--- a/universal.c
+++ b/universal.c
@@ -45,6 +45,8 @@ S_isa_lookup(pTHX_ HV *stash, const char * const name, const HV* const name_stas
const char *hvname;
I32 items;
+ PERL_ARGS_ASSERT_ISA_LOOKUP;
+
/* A stash/class can go by many names (ie. User == main::User), so
we compare the stash itself just in case */
if (name_stash && ((const HV *)stash == name_stash))
@@ -96,6 +98,8 @@ Perl_sv_derived_from(pTHX_ SV *sv, const char *const name)
dVAR;
HV *stash;
+ PERL_ARGS_ASSERT_SV_DERIVED_FROM;
+
SvGETMAGIC(sv);
if (SvROK(sv)) {
@@ -136,8 +140,10 @@ Perl_sv_does(pTHX_ SV *sv, const char *const name)
const char *classname;
bool does_it;
SV *methodname;
-
dSP;
+
+ PERL_ARGS_ASSERT_SV_DOES;
+
ENTER;
SAVETMPS;