: Only used in op.c
pd |PADOFFSET|pad_add_anon |NN SV* sv|OPCODE op_type
#if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
-sd |void |pad_check_dup |NN const char *name|const STRLEN len\
- |const U32 flags|NULLOK const HV *ourstash
+sd |void |pad_check_dup |NN SV *name|const U32 flags \
+ |NULLOK const HV *ourstash
#endif
#ifdef DEBUGGING
: Only used PAD_SETSV() in op.c
#endif
#if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
-#define pad_check_dup(a,b,c,d) S_pad_check_dup(aTHX_ a,b,c,d)
+#define pad_check_dup(a,b,c) S_pad_check_dup(aTHX_ a,b,c)
#endif
#endif
#ifdef DEBUGGING
Perl_croak(aTHX_ "panic: pad_add_name illegal flag bits 0x%" UVxf,
(UV)flags);
-
- if ((flags & pad_add_NO_DUP_CHECK) == 0) {
- /* check for duplicate declaration */
- pad_check_dup(name, len, flags & pad_add_OUR, ourstash);
- }
-
namesv = newSV_type((ourstash || typestash) ? SVt_PVMG : SVt_PVNV);
/* Until we're using the length for real, cross check that we're being told
sv_setpv(namesv, name);
+ if ((flags & pad_add_NO_DUP_CHECK) == 0) {
+ /* check for duplicate declaration */
+ pad_check_dup(namesv, flags & pad_add_OUR, ourstash);
+ }
+
offset = pad_add_name_sv(namesv, flags, typestash, ourstash);
/* not yet introduced */
*/
void
-S_pad_check_dup(pTHX_ const char *name, const STRLEN len, const U32 flags,
- const HV *ourstash)
+S_pad_check_dup(pTHX_ SV *name, const U32 flags, const HV *ourstash)
{
dVAR;
SV **svp;
assert((flags & ~pad_add_OUR) == 0);
- /* 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 */
&& sv != &PL_sv_undef
&& !SvFAKE(sv)
&& (COP_SEQ_RANGE_HIGH(sv) == PAD_MAX || COP_SEQ_RANGE_HIGH(sv) == 0)
- && strEQ(name, SvPVX_const(sv)))
+ && sv_eq(name, sv))
{
if (is_our && (SvPAD_OUR(sv)))
break; /* "our" masking "our" */
&& !SvFAKE(sv)
&& (COP_SEQ_RANGE_HIGH(sv) == PAD_MAX || COP_SEQ_RANGE_HIGH(sv) == 0)
&& SvOURSTASH(sv) == ourstash
- && strEQ(name, SvPVX_const(sv)))
+ && sv_eq(name, sv))
{
Perl_warner(aTHX_ packWARN(WARN_MISC),
"\"our\" variable %"SVf" redeclared", sv);
assert(sv)
#if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
-STATIC void S_pad_check_dup(pTHX_ const char *name, const STRLEN len, const U32 flags, const HV *ourstash)
+STATIC void S_pad_check_dup(pTHX_ SV *name, const U32 flags, const HV *ourstash)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_PAD_CHECK_DUP \
assert(name)