summaryrefslogtreecommitdiff
path: root/locale.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 /locale.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 'locale.c')
-rw-r--r--locale.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/locale.c b/locale.c
index bcae800816..9cd82b8ecb 100644
--- a/locale.c
+++ b/locale.c
@@ -56,6 +56,8 @@ S_stdize_locale(pTHX_ char *locs)
const char * const s = strchr(locs, '=');
bool okay = TRUE;
+ PERL_ARGS_ASSERT_STDIZE_LOCALE;
+
if (s) {
const char * const t = strchr(s, '.');
okay = FALSE;
@@ -174,6 +176,8 @@ Perl_new_ctype(pTHX_ const char *newctype)
dVAR;
int i;
+ PERL_ARGS_ASSERT_NEW_CTYPE;
+
for (i = 0; i < 256; i++) {
if (isUPPER_LC(i))
PL_fold_locale[i] = toLOWER_LC(i);
@@ -184,6 +188,7 @@ Perl_new_ctype(pTHX_ const char *newctype)
}
#endif /* USE_LOCALE_CTYPE */
+ PERL_ARGS_ASSERT_NEW_CTYPE;
PERL_UNUSED_ARG(newctype);
PERL_UNUSED_CONTEXT;
}
@@ -577,6 +582,8 @@ Perl_mem_collxfrm(pTHX_ const char *s, STRLEN len, STRLEN *xlen)
char *xbuf;
STRLEN xAlloc, xin, xout; /* xalloc is a reserved word in VC */
+ PERL_ARGS_ASSERT_MEM_COLLXFRM;
+
/* the first sizeof(collationix) bytes are used by sv_collxfrm(). */
/* the +1 is for the terminating NUL. */