@@ -945,7 +945,7 @@ S_pad_check_dup(pTHX_ PADNAME *name, U32 flags, const HV *ourstash)
945945Given the name of a lexical variable, find its position in the
946946currently-compiling pad.
947947C<namepv>/C<namelen> specify the variable's name, including leading sigil.
948- C<flags> is reserved and must be zero.
948+ C<flags> is reserved and must be zero. (Pads are all UTF8 in cperl)
949949If it is not in the current pad but appears in the pad of any lexically
950950enclosing scope, then a pseudo-entry for it is added in the current pad.
951951Returns the offset in the current pad,
@@ -966,16 +966,16 @@ Perl_pad_findmy_pvn(pTHX_ const char *namepv, STRLEN namelen, U32 flags)
966966 PERL_ARGS_ASSERT_PAD_FINDMY_PVN ;
967967
968968 pad_peg ("pad_findmy_pvn" );
969-
970969 if (flags )
970+ /* With cperl all PADs are UTF8 */
971971 Perl_croak (aTHX_ "panic: pad_findmy_pvn illegal flag bits 0x%" UVxf ,
972972 (UV )flags );
973973
974974 /* compilation errors can zero PL_compcv */
975975 if (!PL_compcv )
976976 return NOT_IN_PAD ;
977977
978- offset = pad_findlex (namepv , namelen , flags ,
978+ offset = pad_findlex (namepv , namelen , 0 ,
979979 PL_compcv , PL_cop_seqmax , 1 , NULL , & out_pn , & out_flags );
980980 if (offset != NOT_IN_PAD )
981981 return offset ;
@@ -1010,13 +1010,15 @@ Perl_pad_findmy_pvn(pTHX_ const char *namepv, STRLEN namelen, U32 flags)
10101010Exactly like L</pad_findmy_pvn>, but takes a nul-terminated string
10111011instead of a string/length pair.
10121012
1013+ flags must be 0.
10131014=cut
10141015*/
10151016
10161017PADOFFSET
10171018Perl_pad_findmy_pv (pTHX_ const char * name , U32 flags )
10181019{
10191020 PERL_ARGS_ASSERT_PAD_FINDMY_PV ;
1021+ assert (!flags );
10201022 return pad_findmy_pvn (name , strlen (name ), flags );
10211023}
10221024
@@ -1026,6 +1028,7 @@ Perl_pad_findmy_pv(pTHX_ const char *name, U32 flags)
10261028Exactly like L</pad_findmy_pvn>, but takes the name string in the form
10271029of an SV instead of a string/length pair.
10281030
1031+ flags must be 0, all pads are utf8
10291032=cut
10301033*/
10311034
@@ -1036,6 +1039,7 @@ Perl_pad_findmy_sv(pTHX_ SV *name, U32 flags)
10361039 STRLEN namelen ;
10371040 PERL_ARGS_ASSERT_PAD_FINDMY_SV ;
10381041 namepv = SvPVutf8 (name , namelen );
1042+ assert (!flags );
10391043 return pad_findmy_pvn (namepv , namelen , flags );
10401044}
10411045
@@ -1125,6 +1129,8 @@ as it goes. It has to be this way
11251129because fake names in anon protoypes have to store in C<xpadn_low> the
11261130index into the parent pad.
11271131
1132+ PADs are with cperl all UTF8 so the flags argument must be 0 or padadd_STALEOK.
1133+
11281134=cut
11291135*/
11301136
@@ -1159,8 +1165,9 @@ S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, U32 flags, const CV* cv,
11591165
11601166 PERL_ARGS_ASSERT_PAD_FINDLEX ;
11611167
1162- flags &= ~ padadd_STALEOK ; /* one-shot flag */
1168+ flags &= ~padadd_STALEOK ; /* one-shot flag */
11631169 if (flags )
1170+ /* With cperl all PADs are utf8 */
11641171 Perl_croak (aTHX_ "panic: pad_findlex illegal flag bits 0x%" UVxf ,
11651172 (UV )flags );
11661173
0 commit comments