summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-11-08 22:23:07 +0000
committerNicholas Clark <nick@ccl4.org>2009-11-09 18:41:53 +0000
commit35f82371218a026d1f07258ae020fffabf397fdc (patch)
treef508a89c7406bcd0da4089201d276d19b81dcdf9 /pad.c
parentd6447115bb9638af823243dbe17f2c14e71cf57d (diff)
downloadperl-35f82371218a026d1f07258ae020fffabf397fdc.tar.gz
Add length and flags arguments to Perl_pad_check_dup().
Currently only pad_add_OUR is used. The length is cross-checked against strlen() on the pointer, but the intent is to re-work the entire pad API to be UTF-8 aware, from the current situation of char * pointers only.
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/pad.c b/pad.c
index becbdc91dd..e9c83fe619 100644
--- a/pad.c
+++ b/pad.c
@@ -540,15 +540,27 @@ C<is_our> indicates that the name to check is an 'our' declaration
/* XXX DAPM integrate this into pad_add_name ??? */
void
-Perl_pad_check_dup(pTHX_ const char *name, bool is_our, const HV *ourstash)
+Perl_pad_check_dup(pTHX_ const char *name, const STRLEN len, const U32 flags,
+ const HV *ourstash)
{
dVAR;
SV **svp;
PADOFFSET top, off;
+ const U32 is_our = flags & pad_add_OUR;
PERL_ARGS_ASSERT_PAD_CHECK_DUP;
ASSERT_CURPAD_ACTIVE("pad_check_dup");
+
+ if (flags & ~pad_add_OUR)
+ Perl_croak(aTHX_ "panic: pad_check_dup illegal flag bits 0x%" UVxf,
+ (UV)flags);
+
+ /* Until we're using the length for real, cross check that we're being told
+ the truth. */
+ PERL_UNUSED_ARG(len);
+ assert(strlen(name) == len);
+
if (AvFILLp(PL_comppad_name) < 0 || !ckWARN(WARN_MISC))
return; /* nothing to check */