X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=toke.c;h=13582da4b055dd6c6063b07d75e66b983e5afbe0;hb=b21a80ce2a669073adfd175b505267b94bc65e88;hp=139a1212cc9b2190ddfba1535bcb1ce8e10bfa21;hpb=97aff369fa5580e7a888d4fa4c86be74ab000409;p=p5sagit%2Fp5-mst-13.2.git diff --git a/toke.c b/toke.c index 139a121..13582da 100644 --- a/toke.c +++ b/toke.c @@ -207,8 +207,11 @@ enum token_type { TOKENTYPE_GVVAL }; -static struct debug_tokens { const int token, type; const char *name; } - const debug_tokens[] = +static struct debug_tokens { + const int token; + enum token_type type; + const char *name; +} const debug_tokens[] = { { ADDOP, TOKENTYPE_OPNUM, "ADDOP" }, { ANDAND, TOKENTYPE_NONE, "ANDAND" }, @@ -285,7 +288,7 @@ S_tokereport(pTHX_ I32 rv) { dVAR; if (DEBUG_T_TEST) { - const char *name = Nullch; + const char *name = NULL; enum token_type type = TOKENTYPE_NONE; const struct debug_tokens *p; SV* const report = newSVpvs("<== "); @@ -602,8 +605,8 @@ Perl_lex_start(pTHX_ SV *line) *PL_lex_casestack = '\0'; PL_lex_dojoin = 0; PL_lex_starts = 0; - PL_lex_stuff = Nullsv; - PL_lex_repl = Nullsv; + PL_lex_stuff = NULL; + PL_lex_repl = NULL; PL_lex_inpat = 0; PL_nexttoke = 0; PL_lex_inwhat = 0; @@ -620,7 +623,7 @@ Perl_lex_start(pTHX_ SV *line) SvTEMP_off(PL_linestr); PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = SvPVX(PL_linestr); PL_bufend = PL_bufptr + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; PL_rsfp = 0; } @@ -783,7 +786,7 @@ S_skipspace(pTHX_ register char *s) /* try to recharge the buffer */ if ((s = filter_gets(PL_linestr, PL_rsfp, - (prevlen = SvCUR(PL_linestr)))) == Nullch) + (prevlen = SvCUR(PL_linestr)))) == NULL) { /* end of file. Add on the -p or -n magic */ if (PL_minus_p) { @@ -802,7 +805,7 @@ S_skipspace(pTHX_ register char *s) PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = s = PL_linestart = SvPVX(PL_linestr); PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; /* Close the filehandle. Could be from -P preprocessor, * STDIN, or a regular file. If we were reading code from @@ -817,7 +820,7 @@ S_skipspace(pTHX_ register char *s) PerlIO_clearerr(PL_rsfp); else (void)PerlIO_close(PL_rsfp); - PL_rsfp = Nullfp; + PL_rsfp = NULL; return s; } @@ -844,7 +847,7 @@ S_skipspace(pTHX_ register char *s) * so store the line into the debugger's array of lines */ if (PERLDB_LINE && PL_curstash != PL_debstash) { - SV * const sv = NEWSV(85,0); + SV * const sv = newSV(0); sv_upgrade(sv, SVt_PVMG); sv_setpvn(sv,PL_bufptr,PL_bufend-PL_bufptr); @@ -878,6 +881,9 @@ S_check_uni(pTHX) for (s = PL_last_uni; isALNUM_lazy_if(s,UTF) || *s == '-'; s++) ; if ((t = strchr(s, '(')) && t < PL_bufptr) return; + + /* XXX Things like this are just so nasty. We shouldn't be modifying + source code, even if we realquick set it back. */ if (ckWARN_d(WARN_AMBIGUOUS)){ const char ch = *s; *s = '\0'; @@ -1019,7 +1025,8 @@ S_force_ident(pTHX_ register const char *s, int kind) { dVAR; if (s && *s) { - OP* const o = (OP*)newSVOP(OP_CONST, 0, newSVpv(s,0)); + const STRLEN len = strlen(s); + OP* const o = (OP*)newSVOP(OP_CONST, 0, newSVpvn(s, len)); PL_nextval[PL_nexttoke].opval = o; force_next(WORD); if (kind) { @@ -1027,12 +1034,14 @@ S_force_ident(pTHX_ register const char *s, int kind) /* XXX see note in pp_entereval() for why we forgo typo warnings if the symbol must be introduced in an eval. GSAR 96-10-12 */ - gv_fetchpv(s, PL_in_eval ? (GV_ADDMULTI | GV_ADDINEVAL) : GV_ADD, - kind == '$' ? SVt_PV : - kind == '@' ? SVt_PVAV : - kind == '%' ? SVt_PVHV : + gv_fetchpvn_flags(s, len, + PL_in_eval ? (GV_ADDMULTI | GV_ADDINEVAL) + : GV_ADD, + kind == '$' ? SVt_PV : + kind == '@' ? SVt_PVAV : + kind == '%' ? SVt_PVHV : SVt_PVGV - ); + ); } } } @@ -1074,7 +1083,7 @@ STATIC char * S_force_version(pTHX_ char *s, int guessing) { dVAR; - OP *version = Nullop; + OP *version = NULL; char *d; s = skipspace(s); @@ -1197,7 +1206,7 @@ S_sublex_start(pTHX) if (op_type == OP_NULL) { yylval.opval = PL_lex_op; - PL_lex_op = Nullop; + PL_lex_op = NULL; return THING; } if (op_type == OP_CONST || op_type == OP_READLINE) { @@ -1206,7 +1215,7 @@ S_sublex_start(pTHX) if (SvTYPE(sv) == SVt_PVIV) { /* Overloaded constants, nothing fancy: Convert to SVt_PV: */ STRLEN len; - const char *p = SvPV_const(sv, len); + const char * const p = SvPV_const(sv, len); SV * const nsv = newSVpvn(p, len); if (SvUTF8(sv)) SvUTF8_on(nsv); @@ -1214,7 +1223,7 @@ S_sublex_start(pTHX) sv = nsv; } yylval.opval = (OP*)newSVOP(op_type, 0, sv); - PL_lex_stuff = Nullsv; + PL_lex_stuff = NULL; /* Allow // "foo" */ if (op_type == OP_READLINE) PL_expect = XTERMORDORDOR; @@ -1229,7 +1238,7 @@ S_sublex_start(pTHX) PL_expect = XTERM; if (PL_lex_op) { yylval.opval = PL_lex_op; - PL_lex_op = Nullop; + PL_lex_op = NULL; return PMFUNC; } else @@ -1271,12 +1280,12 @@ S_sublex_push(pTHX) SAVEGENERICPV(PL_lex_casestack); PL_linestr = PL_lex_stuff; - PL_lex_stuff = Nullsv; + PL_lex_stuff = NULL; PL_bufend = PL_bufptr = PL_oldbufptr = PL_oldoldbufptr = PL_linestart = SvPVX(PL_linestr); PL_bufend += SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; SAVEFREESV(PL_linestr); PL_lex_dojoin = FALSE; @@ -1293,7 +1302,7 @@ S_sublex_push(pTHX) if (PL_lex_inwhat == OP_MATCH || PL_lex_inwhat == OP_QR || PL_lex_inwhat == OP_SUBST) PL_lex_inpat = PL_sublex_info.sub_op; else - PL_lex_inpat = Nullop; + PL_lex_inpat = NULL; return '('; } @@ -1327,7 +1336,7 @@ S_sublex_done(pTHX) PL_lex_inpat = 0; PL_bufend = PL_bufptr = PL_oldbufptr = PL_oldoldbufptr = PL_linestart = SvPVX(PL_linestr); PL_bufend += SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; SAVEFREESV(PL_linestr); PL_lex_dojoin = FALSE; PL_lex_brackets = 0; @@ -1344,7 +1353,7 @@ S_sublex_done(pTHX) } else { PL_lex_state = LEX_INTERPCONCAT; - PL_lex_repl = Nullsv; + PL_lex_repl = NULL; } return ','; } @@ -1436,7 +1445,7 @@ S_scan_const(pTHX_ char *start) { dVAR; register char *send = PL_bufend; /* end of the constant */ - SV *sv = NEWSV(93, send - start); /* sv for the constant */ + SV *sv = newSV(send - start); /* sv for the constant */ register char *s = start; /* start of the constant */ register char *d = SvPVX(sv); /* destination for copies */ bool dorange = FALSE; /* are we in a translit range? */ @@ -1779,8 +1788,8 @@ S_scan_const(pTHX_ char *start) goto NUM_ESCAPE_INSERT; } res = newSVpvn(s + 1, e - s - 1); - res = new_constant( Nullch, 0, "charnames", - res, Nullsv, "\\N{...}" ); + res = new_constant( NULL, 0, "charnames", + res, NULL, "\\N{...}" ); if (has_utf8) sv_utf8_upgrade(res); str = SvPV_const(res,len); @@ -1884,15 +1893,15 @@ S_scan_const(pTHX_ char *start) and then encode the next character */ if ((has_utf8 || this_utf8) && !NATIVE_IS_INVARIANT((U8)(*s))) { STRLEN len = 1; - const UV uv = (this_utf8) ? utf8n_to_uvchr((U8*)s, send - s, &len, 0) : (UV) ((U8) *s); - const STRLEN need = UNISKIP(NATIVE_TO_UNI(uv)); + const UV nextuv = (this_utf8) ? utf8n_to_uvchr((U8*)s, send - s, &len, 0) : (UV) ((U8) *s); + const STRLEN need = UNISKIP(NATIVE_TO_UNI(nextuv)); s += len; if (need > len) { /* encoded value larger than old, need extra space (NOTE: SvCUR() not set here) */ const STRLEN off = d - SvPVX_const(sv); d = SvGROW(sv, SvLEN(sv) + (need-len)) + off; } - d = (char*)uvchr_to_utf8((U8*)d, uv); + d = (char*)uvchr_to_utf8((U8*)d, nextuv); has_utf8 = TRUE; } else { @@ -1929,7 +1938,7 @@ S_scan_const(pTHX_ char *start) if (s > PL_bufptr) { if ( PL_hints & ( PL_lex_inpat ? HINT_NEW_RE : HINT_NEW_STRING ) ) sv = new_constant(start, s - start, (PL_lex_inpat ? "qr" : "q"), - sv, Nullsv, + sv, NULL, ( PL_lex_inwhat == OP_TRANS ? "tr" : ( (PL_lex_inwhat == OP_SUBST && !PL_lex_inpat) @@ -2028,9 +2037,10 @@ S_intuit_more(pTHX_ register char *s) case '$': weight -= seen[un_char] * 10; if (isALNUM_lazy_if(s+1,UTF)) { + int len; scan_ident(s, send, tmpbuf, sizeof tmpbuf, FALSE); - if ((int)strlen(tmpbuf) > 1 - && gv_fetchpv(tmpbuf, 0, SVt_PV)) + len = (int)strlen(tmpbuf); + if (len > 1 && gv_fetchpvn_flags(tmpbuf, len, 0, SVt_PV)) weight -= 100; else weight -= 10; @@ -2163,7 +2173,7 @@ S_intuit_method(pTHX_ char *start, GV *gv, CV *cv) tmpbuf[len] = '\0'; goto bare_package; } - indirgv = gv_fetchpv(tmpbuf, 0, SVt_PVCV); + indirgv = gv_fetchpvn_flags(tmpbuf, len, 0, SVt_PVCV); if (indirgv && GvCVu(indirgv)) return 0; /* filehandle or package name makes it a method */ @@ -2229,12 +2239,12 @@ Perl_filter_add(pTHX_ filter_t funcp, SV *datasv) { dVAR; if (!funcp) - return Nullsv; + return NULL; if (!PL_rsfp_filters) PL_rsfp_filters = newAV(); if (!datasv) - datasv = NEWSV(255,0); + datasv = newSV(0); SvUPGRADE(datasv, SVt_PVIO); IoANY(datasv) = FPTR2DPTR(void *, funcp); /* stash funcp into spare field */ IoFLAGS(datasv) |= IOf_FAKE_DIRP; @@ -2346,7 +2356,7 @@ S_filter_gets(pTHX_ register SV *sv, register PerlIO *fp, STRLEN append) if (FILTER_READ(0, sv, 0) > 0) return ( SvPVX(sv) ) ; else - return Nullch ; + return NULL ; } else return (sv_gets(sv, fp, append)); @@ -2363,13 +2373,13 @@ S_find_in_my_stash(pTHX_ const char *pkgname, I32 len) if (len > 2 && (pkgname[len - 2] == ':' && pkgname[len - 1] == ':') && - (gv = gv_fetchpv(pkgname, 0, SVt_PVHV))) + (gv = gv_fetchpvn_flags(pkgname, len, 0, SVt_PVHV))) { return GvHV(gv); /* Foo:: */ } /* use constant CLASS => 'MyClass' */ - if ((gv = gv_fetchpv(pkgname, 0, SVt_PVCV))) { + if ((gv = gv_fetchpvn_flags(pkgname, len, 0, SVt_PVCV))) { SV *sv; if (GvCV(gv) && (sv = cv_const_sv(GvCV(gv)))) { pkgname = SvPV_nolen_const(sv); @@ -2389,7 +2399,7 @@ S_tokenize_use(pTHX_ int is_use, char *s) { if (isDIGIT(*s) || (*s == 'v' && isDIGIT(s[1]))) { s = force_version(s, TRUE); if (*s == ';' || (s = skipspace(s), *s == ';')) { - PL_nextval[PL_nexttoke].opval = Nullop; + PL_nextval[PL_nexttoke].opval = NULL; force_next(WORD); } else if (*s == 'v') { @@ -2612,7 +2622,7 @@ Perl_yylex(pTHX) { if (PL_bufptr != PL_bufend) Perl_croak(aTHX_ "Bad evalled substitution pattern"); - PL_lex_repl = Nullsv; + PL_lex_repl = NULL; } /* FALLTHROUGH */ case LEX_INTERPCONCAT: @@ -2748,9 +2758,9 @@ Perl_yylex(pTHX) sv_catpvs(PL_linestr, "\n"); PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr); PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; if (PERLDB_LINE && PL_curstash != PL_debstash) { - SV * const sv = NEWSV(85,0); + SV * const sv = newSV(0); sv_upgrade(sv, SVt_PVMG); sv_setsv(sv,PL_linestr); @@ -2762,7 +2772,7 @@ Perl_yylex(pTHX) } do { bof = PL_rsfp ? TRUE : FALSE; - if ((s = filter_gets(PL_linestr, PL_rsfp, 0)) == Nullch) { + if ((s = filter_gets(PL_linestr, PL_rsfp, 0)) == NULL) { fake_eof: if (PL_rsfp) { if (PL_preprocess && !PL_in_eval) @@ -2771,7 +2781,7 @@ Perl_yylex(pTHX) PerlIO_clearerr(PL_rsfp); else (void)PerlIO_close(PL_rsfp); - PL_rsfp = Nullfp; + PL_rsfp = NULL; PL_doextract = FALSE; } if (!PL_in_eval && (PL_minus_n || PL_minus_p)) { @@ -2779,12 +2789,12 @@ Perl_yylex(pTHX) ? ";}continue{print;}" : ";}"); PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr); PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; PL_minus_n = PL_minus_p = 0; goto retry; } PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; sv_setpvn(PL_linestr,"",0); TOKEN(';'); /* not infinite loop because rsfp is NULL now */ } @@ -2829,7 +2839,7 @@ Perl_yylex(pTHX) sv_setpvn(PL_linestr, "", 0); PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr); PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; PL_doextract = FALSE; } } @@ -2837,7 +2847,7 @@ Perl_yylex(pTHX) } while (PL_doextract); PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = s; if (PERLDB_LINE && PL_curstash != PL_debstash) { - SV * const sv = NEWSV(85,0); + SV * const sv = newSV(0); sv_upgrade(sv, SVt_PVMG); sv_setsv(sv,PL_linestr); @@ -2846,13 +2856,13 @@ Perl_yylex(pTHX) av_store(CopFILEAVx(PL_curcop),(I32)CopLINE(PL_curcop),sv); } PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; if (CopLINE(PL_curcop) == 1) { while (s < PL_bufend && isSPACE(*s)) s++; if (*s == ':' && s[1] != ':') /* for csh execing sh scripts */ s++; - d = Nullch; + d = NULL; if (!PL_in_eval) { if (*s == '#' && *(s+1) == '!') d = s + 2; @@ -2883,8 +2893,8 @@ Perl_yylex(pTHX) * at least, set argv[0] to the basename of the Perl * interpreter. So, having found "#!", we'll set it right. */ - SV * const x - = GvSV(gv_fetchpv("\030", GV_ADD, SVt_PV)); /* $^X */ + SV * const x = GvSV(gv_fetchpvs("\030", GV_ADD|GV_NOTQUAL, + SVt_PV)); /* $^X */ assert(SvPOK(x) || SvGMAGICAL(x)); if (sv_eq(x, CopFILESV(PL_curcop))) { sv_setpvn(x, ipath, ipathend - ipath); @@ -2925,7 +2935,7 @@ Perl_yylex(pTHX) } } if (d < ipath) - d = Nullch; + d = NULL; } #endif } @@ -2944,7 +2954,7 @@ Perl_yylex(pTHX) while (*c && !strchr("; \t\r\n\f\v#", *c)) c++; if (c < d) - d = Nullch; /* "perl" not in first word; ignore */ + d = NULL; /* "perl" not in first word; ignore */ else *s = '#'; /* Don't try to parse shebang line */ } @@ -2982,15 +2992,15 @@ Perl_yylex(pTHX) } #endif if (d) { - const U32 oldpdb = PL_perldb; - const bool oldn = PL_minus_n; - const bool oldp = PL_minus_p; - while (*d && !isSPACE(*d)) d++; while (SPACE_OR_TAB(*d)) d++; if (*d++ == '-') { const bool switches_done = PL_doswitches; + const U32 oldpdb = PL_perldb; + const bool oldn = PL_minus_n; + const bool oldp = PL_minus_p; + do { if (*d == 'M' || *d == 'm' || *d == 'C') { const char * const m = d; @@ -3016,7 +3026,7 @@ Perl_yylex(pTHX) sv_setpvn(PL_linestr, "", 0); PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr); PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; PL_preambled = FALSE; if (PERLDB_LINE) (void)gv_fetchfile(PL_origfilename); @@ -3117,7 +3127,7 @@ Perl_yylex(pTHX) case 'T': ftst = OP_FTTEXT; break; case 'B': ftst = OP_FTBINARY; break; case 'M': case 'A': case 'C': - gv_fetchpv("\024",GV_ADD, SVt_PV); + gv_fetchpvs("\024", GV_ADD|GV_NOTQUAL, SVt_PV); switch (tmp) { case 'M': ftst = OP_FTMTIME; break; case 'A': ftst = OP_FTATIME; break; @@ -3262,7 +3272,7 @@ Perl_yylex(pTHX) PL_expect = XTERMBLOCK; grabattrs: s = skipspace(s); - attrs = Nullop; + attrs = NULL; while (isIDFIRST_lazy_if(s,UTF)) { I32 tmp; d = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, FALSE, &len); @@ -3301,7 +3311,7 @@ Perl_yylex(pTHX) attrs = append_elem(OP_LIST, attrs, newSVOP(OP_CONST, 0, sv)); SvREFCNT_dec(PL_lex_stuff); - PL_lex_stuff = Nullsv; + PL_lex_stuff = NULL; } else { if (len == 6 && strnEQ(s, "unique", len)) { @@ -3309,7 +3319,7 @@ Perl_yylex(pTHX) #ifdef USE_ITHREADS GvUNIQUE_on(cGVOPx_gv(yylval.opval)); #else - ; /* skip to avoid loading attributes.pm */ + /*EMPTY*/; /* skip to avoid loading attributes.pm */ #endif else Perl_croak(aTHX_ "The 'unique' attribute may only be applied to 'our' variables"); @@ -3836,9 +3846,9 @@ Perl_yylex(pTHX) char tmpbuf[sizeof PL_tokenbuf]; for (t++; isSPACE(*t); t++) ; if (isIDFIRST_lazy_if(t,UTF)) { - STRLEN len; + STRLEN dummylen; t = scan_word(t, tmpbuf, sizeof tmpbuf, TRUE, - &len); + &dummylen); for (; isSPACE(*t); t++) ; if (*t == ';' && get_cv(tmpbuf, FALSE)) Perl_warner(aTHX_ packWARN(WARN_SYNTAX), @@ -4182,7 +4192,7 @@ Perl_yylex(pTHX) GV *hgv = NULL; /* hidden (loser) */ if (PL_expect != XOPERATOR && (*s != ':' || s[1] != ':')) { CV *cv; - if ((gv = gv_fetchpv(PL_tokenbuf, 0, SVt_PVCV)) && + if ((gv = gv_fetchpvn_flags(PL_tokenbuf, len, 0, SVt_PVCV)) && (cv = GvCVu(gv))) { if (GvIMPORTED_CV(gv)) @@ -4205,7 +4215,7 @@ Perl_yylex(pTHX) else if (gv && !gvp && -tmp==KEY_lock /* XXX generalizable kludge */ && GvCVu(gv) - && !hv_fetch(GvHVn(PL_incgv), "Thread.pm", 9, FALSE)) + && !hv_fetchs(GvHVn(PL_incgv), "Thread.pm", FALSE)) { tmp = 0; /* any sub overrides "weak" keyword */ } @@ -4215,7 +4225,7 @@ Perl_yylex(pTHX) Perl_warner(aTHX_ packWARN(WARN_MISC), "dump() better written as CORE::dump()"); } - gv = Nullgv; + gv = NULL; gvp = 0; if (hgv && tmp != KEY_x && tmp != KEY_CORE && ckWARN(WARN_AMBIGUOUS)) /* never ambiguous */ @@ -4237,6 +4247,7 @@ Perl_yylex(pTHX) just_a_word_zero_gv: gv = NULL; gvp = NULL; + orig_keyword = 0; } just_a_word: { SV *sv; @@ -4275,25 +4286,25 @@ Perl_yylex(pTHX) PL_tokenbuf[len - 2] == ':' && PL_tokenbuf[len - 1] == ':') { if (ckWARN(WARN_BAREWORD) - && ! gv_fetchpv(PL_tokenbuf, 0, SVt_PVHV)) + && ! gv_fetchpvn_flags(PL_tokenbuf, len, 0, SVt_PVHV)) Perl_warner(aTHX_ packWARN(WARN_BAREWORD), "Bareword \"%s\" refers to nonexistent package", PL_tokenbuf); len -= 2; PL_tokenbuf[len] = '\0'; - gv = Nullgv; + gv = NULL; gvp = 0; } else { - len = 0; if (!gv) { /* Mustn't actually add anything to a symbol table. But also don't want to "initialise" any placeholder constants that might already be there into full blown PVGVs with attached PVCV. */ - gv = gv_fetchpv(PL_tokenbuf, GV_NOADD_NOINIT, - SVt_PVCV); + gv = gv_fetchpvn_flags(PL_tokenbuf, len, + GV_NOADD_NOINIT, SVt_PVCV); } + len = 0; } /* if we saw a global override before, get the right name */ @@ -4432,7 +4443,7 @@ Perl_yylex(pTHX) if ((sv = gv_const_sv(gv))) { its_constant: SvREFCNT_dec(((SVOP*)yylval.opval)->op_sv); - ((SVOP*)yylval.opval)->op_sv = SvREFCNT_inc(sv); + ((SVOP*)yylval.opval)->op_sv = SvREFCNT_inc_simple(sv); yylval.opval->op_private = 0; TOKEN(WORD); } @@ -4453,9 +4464,9 @@ Perl_yylex(pTHX) PL_last_lop_op = OP_ENTERSUB; /* Is there a prototype? */ if (SvPOK(cv)) { - STRLEN len; - const char *proto = SvPV_const((SV*)cv, len); - if (!len) + STRLEN protolen; + const char *proto = SvPV_const((SV*)cv, protolen); + if (!protolen) TERM(FUNC0SUB); if (*proto == '$' && proto[1] == '\0') OPERATOR(UNIOPSUB); @@ -4599,7 +4610,7 @@ Perl_yylex(pTHX) } } #endif - PL_rsfp = Nullfp; + PL_rsfp = NULL; } goto fake_eof; } @@ -4683,7 +4694,8 @@ Perl_yylex(pTHX) } case KEY_chdir: - (void)gv_fetchpv("ENV", GV_ADD, SVt_PVHV); /* may use HOME */ + /* may use HOME */ + (void)gv_fetchpvs("ENV", GV_ADD|GV_NOTQUAL, SVt_PVHV); UNI(OP_CHDIR); case KEY_close: @@ -4753,7 +4765,7 @@ Perl_yylex(pTHX) UNI(OP_DELETE); case KEY_dbmopen: - gv_fetchpv("AnyDBM_File::ISA", GV_ADDMULTI, SVt_PVAV); + gv_fetchpvs("AnyDBM_File::ISA", GV_ADDMULTI, SVt_PVAV); LOP(OP_DBMOPEN,XTERM); case KEY_dbmclose: @@ -5092,10 +5104,10 @@ Perl_yylex(pTHX) /* [perl #16184] */ && !(t[0] == '=' && t[1] == '>') ) { - int len = (int)(d-s); + int parms_len = (int)(d-s); Perl_warner(aTHX_ packWARN(WARN_PRECEDENCE), "Precedence problem: open %.*s should be open(%.*s)", - len, s, len, s); + parms_len, s, parms_len, s); } } LOP(OP_OPEN,XTERM); @@ -5160,7 +5172,7 @@ Perl_yylex(pTHX) PL_expect = XOPERATOR; force_next(')'); if (SvCUR(PL_lex_stuff)) { - OP *words = Nullop; + OP *words = NULL; int warned = 0; d = SvPV_force(PL_lex_stuff, len); while (len) { @@ -5199,7 +5211,7 @@ Perl_yylex(pTHX) } if (PL_lex_stuff) { SvREFCNT_dec(PL_lex_stuff); - PL_lex_stuff = Nullsv; + PL_lex_stuff = NULL; } PL_expect = XTERM; TOKEN('('); @@ -5523,7 +5535,7 @@ Perl_yylex(pTHX) if (have_proto) { PL_nextval[PL_nexttoke].opval = (OP*)newSVOP(OP_CONST, 0, PL_lex_stuff); - PL_lex_stuff = Nullsv; + PL_lex_stuff = NULL; force_next(THING); } if (!have_name) { @@ -5657,10 +5669,11 @@ Perl_yylex(pTHX) char ctl_l[2]; ctl_l[0] = toCTRL('L'); ctl_l[1] = '\0'; - gv_fetchpv(ctl_l, GV_ADD, SVt_PV); + gv_fetchpvn_flags(ctl_l, 1, GV_ADD|GV_NOTQUAL, SVt_PV); } #else - gv_fetchpv("\f", GV_ADD, SVt_PV); /* Make sure $^L is defined */ + /* Make sure $^L is defined */ + gv_fetchpvs("\f", GV_ADD|GV_NOTQUAL, SVt_PV); #endif UNI(OP_ENTERWRITE); @@ -5738,7 +5751,7 @@ S_pending_ident(pTHX) tmp = pad_findmy(PL_tokenbuf); if (tmp != NOT_IN_PAD) { /* might be an "our" variable" */ - if (PAD_COMPNAME_FLAGS(tmp) & SVpad_OUR) { + if (PAD_COMPNAME_FLAGS_isOUR(tmp)) { /* build ops for a bareword */ HV * const stash = PAD_COMPNAME_OURSTASH(tmp); HEK * const stashname = HvNAME_HEK(stash); @@ -5803,21 +5816,21 @@ S_pending_ident(pTHX) yylval.opval->op_private = OPpCONST_ENTERED; gv_fetchpv( PL_tokenbuf+1, - PL_in_eval - ? (GV_ADDMULTI | GV_ADDINEVAL) - /* If the identifier refers to a stash, don't autovivify it. - * Change 24660 had the side effect of causing symbol table - * hashes to always be defined, even if they were freshly - * created and the only reference in the entire program was - * the single statement with the defined %foo::bar:: test. - * It appears that all code in the wild doing this actually - * wants to know whether sub-packages have been loaded, so - * by avoiding auto-vivifying symbol tables, we ensure that - * defined %foo::bar:: continues to be false, and the existing - * tests still give the expected answers, even though what - * they're actually testing has now changed subtly. - */ - : !(*PL_tokenbuf == '%' && *(d = PL_tokenbuf + strlen(PL_tokenbuf) - 1) == ':' && d[-1] == ':'), + /* If the identifier refers to a stash, don't autovivify it. + * Change 24660 had the side effect of causing symbol table + * hashes to always be defined, even if they were freshly + * created and the only reference in the entire program was + * the single statement with the defined %foo::bar:: test. + * It appears that all code in the wild doing this actually + * wants to know whether sub-packages have been loaded, so + * by avoiding auto-vivifying symbol tables, we ensure that + * defined %foo::bar:: continues to be false, and the existing + * tests still give the expected answers, even though what + * they're actually testing has now changed subtly. + */ + (*PL_tokenbuf == '%' && *(d = PL_tokenbuf + strlen(PL_tokenbuf) - 1) == ':' && d[-1] == ':' + ? 0 + : PL_in_eval ? (GV_ADDMULTI | GV_ADDINEVAL) : GV_ADD), ((PL_tokenbuf[0] == '$') ? SVt_PV : (PL_tokenbuf[0] == '@') ? SVt_PVAV : SVt_PVHV)); @@ -9316,11 +9329,11 @@ S_new_constant(pTHX_ const char *s, STRLEN len, const char *key, SV *sv, SV *pv, sv_catpvs(ERRSV, "Propagated"); yyerror(SvPV_nolen_const(ERRSV)); /* Duplicates the message inside eval */ (void)POPs; - res = SvREFCNT_inc(sv); + res = SvREFCNT_inc_simple(sv); } else { res = POPs; - (void)SvREFCNT_inc(res); + SvREFCNT_inc_simple_void(res); } PUTBACK ; @@ -9384,15 +9397,13 @@ STATIC char * S_scan_ident(pTHX_ register char *s, register const char *send, char *dest, STRLEN destlen, I32 ck_uni) { dVAR; - register char *d; - register char *e; - char *bracket = Nullch; + char *bracket = NULL; char funny = *s++; + register char *d = dest; + register char * const e = d + destlen + 3; /* two-character token, ending NUL */ if (isSPACE(*s)) s = skipspace(s); - d = dest; - e = d + destlen - 3; /* two-character token, ending NUL */ if (isDIGIT(*s)) { while (isDIGIT(*s)) { if (d >= e) @@ -9467,15 +9478,15 @@ S_scan_ident(pTHX_ register char *s, register const char *send, char *dest, STRL if (isIDFIRST_lazy_if(d,UTF)) { d++; if (UTF) { - e = s; - while ((e < send && isALNUM_lazy_if(e,UTF)) || *e == ':') { - e += UTF8SKIP(e); - while (e < send && UTF8_IS_CONTINUED(*e) && is_utf8_mark((U8*)e)) - e += UTF8SKIP(e); + char *end = s; + while ((end < send && isALNUM_lazy_if(end,UTF)) || *end == ':') { + end += UTF8SKIP(end); + while (end < send && UTF8_IS_CONTINUED(*end) && is_utf8_mark((U8*)end)) + end += UTF8SKIP(end); } - Copy(s, d, e - s, char); - d += e - s; - s = e; + Copy(s, d, end - s, char); + d += end - s; + s = end; } else { while ((isALNUM(*s) || *s == ':') && d < e) @@ -9541,6 +9552,7 @@ S_scan_ident(pTHX_ register char *s, register const char *send, char *dest, STRL void Perl_pmflag(pTHX_ U32* pmfl, int ch) { + PERL_UNUSED_CONTEXT; if (ch == 'i') *pmfl |= PMf_FOLD; else if (ch == 'g') @@ -9563,9 +9575,10 @@ S_scan_pat(pTHX_ char *start, I32 type) dVAR; PMOP *pm; char *s = scan_str(start,FALSE,FALSE); + const char * const valid_flags = (type == OP_QR) ? "iomsx" : "iogcmsx"; if (!s) { - char * const delimiter = skipspace(start); + const char * const delimiter = skipspace(start); Perl_croak(aTHX_ *delimiter == '?' ? "Search pattern not terminated or ternary operator parsed as search pattern" : "Search pattern not terminated" ); @@ -9574,14 +9587,8 @@ S_scan_pat(pTHX_ char *start, I32 type) pm = (PMOP*)newPMOP(type, 0); if (PL_multi_open == '?') pm->op_pmflags |= PMf_ONCE; - if(type == OP_QR) { - while (*s && strchr("iomsx", *s)) - pmflag(&pm->op_pmflags,*s++); - } - else { - while (*s && strchr("iogcmsx", *s)) - pmflag(&pm->op_pmflags,*s++); - } + while (*s && strchr(valid_flags, *s)) + pmflag(&pm->op_pmflags,*s++); /* issue a warning if /c is specified,but /g is not */ if ((pm->op_pmflags & PMf_CONTINUE) && !(pm->op_pmflags & PMf_GLOBAL) && ckWARN(WARN_REGEXP)) @@ -9620,7 +9627,7 @@ S_scan_subst(pTHX_ char *start) if (!s) { if (PL_lex_stuff) { SvREFCNT_dec(PL_lex_stuff); - PL_lex_stuff = Nullsv; + PL_lex_stuff = NULL; } Perl_croak(aTHX_ "Substitution replacement not terminated"); } @@ -9643,12 +9650,12 @@ S_scan_subst(pTHX_ char *start) } if (es) { - SV *repl; + SV * const repl = newSVpvs(""); + PL_sublex_info.super_bufptr = s; PL_sublex_info.super_bufend = PL_bufend; PL_multi_end = 0; pm->op_pmflags |= PMf_EVAL; - repl = newSVpvs(""); while (es-- > 0) sv_catpv(repl, es ? "eval " : "do "); sv_catpvs(repl, "{ "); @@ -9688,7 +9695,7 @@ S_scan_trans(pTHX_ char *start) if (!s) { if (PL_lex_stuff) { SvREFCNT_dec(PL_lex_stuff); - PL_lex_stuff = Nullsv; + PL_lex_stuff = NULL; } Perl_croak(aTHX_ "Transliteration replacement not terminated"); } @@ -9803,7 +9810,7 @@ S_scan_heredoc(pTHX_ register char *s) } s += SvCUR(herewas); - tmpstr = NEWSV(87,79); + tmpstr = newSV(79); sv_upgrade(tmpstr, SVt_PVIV); if (term == '\'') { op_type = OP_CONST; @@ -9819,8 +9826,8 @@ S_scan_heredoc(pTHX_ register char *s) PL_multi_open = PL_multi_close = '<'; term = *PL_tokenbuf; if (PL_lex_inwhat == OP_SUBST && PL_in_eval && !PL_rsfp) { - char *bufptr = PL_sublex_info.super_bufptr; - char *bufend = PL_sublex_info.super_bufend; + char * const bufptr = PL_sublex_info.super_bufptr; + char * const bufend = PL_sublex_info.super_bufend; char * const olds = s - SvCUR(herewas); s = strchr(bufptr, '\n'); if (!s) @@ -9863,7 +9870,7 @@ S_scan_heredoc(pTHX_ register char *s) sv_setsv(PL_linestr,herewas); PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = s = PL_linestart = SvPVX(PL_linestr); PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; } else sv_setpvn(tmpstr,"",0); /* avoid "uninitialized" warning */ @@ -9875,7 +9882,7 @@ S_scan_heredoc(pTHX_ register char *s) } CopLINE_inc(PL_curcop); PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; #ifndef PERL_STRICT_CR if (PL_bufend - PL_linestart >= 2) { if ((PL_bufend[-2] == '\r' && PL_bufend[-1] == '\n') || @@ -9892,7 +9899,7 @@ S_scan_heredoc(pTHX_ register char *s) PL_bufend[-1] = '\n'; #endif if (PERLDB_LINE && PL_curstash != PL_debstash) { - SV *sv = NEWSV(88,0); + SV * const sv = newSV(0); sv_upgrade(sv, SVt_PVMG); sv_setsv(sv,PL_linestr); @@ -9951,13 +9958,12 @@ S_scan_inputsymbol(pTHX_ char *start) { dVAR; register char *s = start; /* current position in buffer */ - register char *d; - const char *e; char *end; I32 len; - d = PL_tokenbuf; /* start of temp holding space */ - e = PL_tokenbuf + sizeof PL_tokenbuf; /* end of temp holding space */ + char *d = PL_tokenbuf; /* start of temp holding space */ + const char * const e = PL_tokenbuf + sizeof PL_tokenbuf; /* end of temp holding space */ + end = strchr(s, '\n'); if (!end) end = PL_bufend; @@ -10003,7 +10009,7 @@ S_scan_inputsymbol(pTHX_ char *start) } else { bool readline_overriden = FALSE; - GV *gv_readline = Nullgv; + GV *gv_readline; GV **gvp; /* we're in a filehandle read situation */ d = PL_tokenbuf; @@ -10013,10 +10019,11 @@ S_scan_inputsymbol(pTHX_ char *start) Copy("ARGV",d,5,char); /* Check whether readline() is overriden */ - if (((gv_readline = gv_fetchpv("readline", 0, SVt_PVCV)) + gv_readline = gv_fetchpvs("readline", GV_NOTQUAL, SVt_PVCV); + if ((gv_readline && GvCVu(gv_readline) && GvIMPORTED_CV(gv_readline)) || - ((gvp = (GV**)hv_fetch(PL_globalstash, "readline", 8, FALSE)) + ((gvp = (GV**)hv_fetchs(PL_globalstash, "readline", FALSE)) && (gv_readline = *gvp) != (GV*)&PL_sv_undef && GvCVu(gv_readline) && GvIMPORTED_CV(gv_readline))) readline_overriden = TRUE; @@ -10031,17 +10038,17 @@ S_scan_inputsymbol(pTHX_ char *start) add symbol table ops */ if ((tmp = pad_findmy(d)) != NOT_IN_PAD) { - if (PAD_COMPNAME_FLAGS(tmp) & SVpad_OUR) { - HV *stash = PAD_COMPNAME_OURSTASH(tmp); - HEK *stashname = HvNAME_HEK(stash); - SV *sym = sv_2mortal(newSVhek(stashname)); + if (PAD_COMPNAME_FLAGS_isOUR(tmp)) { + HV * const stash = PAD_COMPNAME_OURSTASH(tmp); + HEK * const stashname = HvNAME_HEK(stash); + SV * const sym = sv_2mortal(newSVhek(stashname)); sv_catpvs(sym, "::"); sv_catpv(sym, d+1); d = SvPVX(sym); goto intro_sym; } else { - OP *o = newOP(OP_PADSV, 0); + OP * const o = newOP(OP_PADSV, 0); o->op_targ = tmp; PL_lex_op = readline_overriden ? (OP*)newUNOP(OP_ENTERSUB, OPf_STACKED, @@ -10077,7 +10084,7 @@ intro_sym: /* If it's none of the above, it must be a literal filehandle ( or ) so build a simple readline OP */ else { - GV *gv = gv_fetchpv(d, GV_ADD, SVt_PVIO); + GV * const gv = gv_fetchpv(d, GV_ADD, SVt_PVIO); PL_lex_op = readline_overriden ? (OP*)newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, @@ -10181,9 +10188,9 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims) PL_multi_close = term; - /* create a new SV to hold the contents. 87 is leak category, I'm - assuming. 79 is the SV's initial length. What a random number. */ - sv = NEWSV(87,79); + /* create a new SV to hold the contents. 79 is the SV's initial length. + What a random number. */ + sv = newSV(79); sv_upgrade(sv, SVt_PVIV); SvIV_set(sv, termcode); (void)SvPOK_only(sv); /* validate pointer */ @@ -10200,8 +10207,8 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims) int offset = s - SvPVX_const(PL_linestr); const bool found = sv_cat_decode(sv, PL_encoding, PL_linestr, &offset, (char*)termstr, termlen); - const char *ns = SvPVX_const(PL_linestr) + offset; - char *svlast = SvEND(sv) - 1; + const char * const ns = SvPVX_const(PL_linestr) + offset; + char * const svlast = SvEND(sv) - 1; for (; s < ns; s++) { if (*s == '\n' && !PL_rsfp) @@ -10360,25 +10367,25 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims) !(PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = filter_gets(PL_linestr, PL_rsfp, 0))) { sv_free(sv); CopLINE_set(PL_curcop, (line_t)PL_multi_start); - return Nullch; + return NULL; } /* we read a line, so increment our line counter */ CopLINE_inc(PL_curcop); /* update debugger info */ if (PERLDB_LINE && PL_curstash != PL_debstash) { - SV * const sv = NEWSV(88,0); + SV * const line_sv = newSV(0); - sv_upgrade(sv, SVt_PVMG); - sv_setsv(sv,PL_linestr); - (void)SvIOK_on(sv); - SvIV_set(sv, 0); - av_store(CopFILEAVx(PL_curcop), (I32)CopLINE(PL_curcop), sv); + sv_upgrade(line_sv, SVt_PVMG); + sv_setsv(line_sv,PL_linestr); + (void)SvIOK_on(line_sv); + SvIV_set(line_sv, 0); + av_store(CopFILEAVx(PL_curcop), (I32)CopLINE(PL_curcop), line_sv); } /* having changed the buffer, we must update PL_bufend */ PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; } /* at this point, we have successfully read the delimited string */ @@ -10440,7 +10447,7 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) register char *d; /* destination in temp buffer */ register char *e; /* end of temp buffer */ NV nv; /* number read, as a double */ - SV *sv = Nullsv; /* place to put the converted number */ + SV *sv = NULL; /* place to put the converted number */ bool floatit; /* boolean: int or float? */ const char *lastub = NULL; /* position of last underbar */ static char const number_too_long[] = "Number too long"; @@ -10605,7 +10612,7 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "Misplaced _ in number"); } - sv = NEWSV(92,0); + sv = newSV(0); if (overflowed) { if (n > 4294967295.0 && ckWARN(WARN_PORTABLE)) Perl_warner(aTHX_ packWARN(WARN_PORTABLE), @@ -10624,9 +10631,9 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) } if (just_zero && (PL_hints & HINT_NEW_INTEGER)) sv = new_constant(start, s - start, "integer", - sv, Nullsv, NULL); + sv, NULL, NULL); else if (PL_hints & HINT_NEW_BINARY) - sv = new_constant(start, s - start, "binary", sv, Nullsv, NULL); + sv = new_constant(start, s - start, "binary", sv, NULL, NULL); } break; @@ -10758,7 +10765,7 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) /* make an sv from the string */ - sv = NEWSV(92,0); + sv = newSV(0); /* We try to do an integer conversion first if no characters @@ -10767,7 +10774,7 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) if (!floatit) { UV uv; - int flags = grok_number (PL_tokenbuf, d - PL_tokenbuf, &uv); + const int flags = grok_number (PL_tokenbuf, d - PL_tokenbuf, &uv); if (flags == IS_NUMBER_IN_UV) { if (uv <= IV_MAX) @@ -10793,13 +10800,13 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) (PL_hints & HINT_NEW_INTEGER) ) sv = new_constant(PL_tokenbuf, d - PL_tokenbuf, (floatit ? "float" : "integer"), - sv, Nullsv, NULL); + sv, NULL, NULL); break; /* if it starts with a v, it could be a v-string */ case 'v': vstring: - sv = NEWSV(92,5); /* preallocate storage space */ + sv = newSV(5); /* preallocate storage space */ s = scan_vstring(s,sv); break; } @@ -10809,7 +10816,7 @@ vstring: if (sv) lvalp->opval = newSVOP(OP_CONST, 0, sv); else - lvalp->opval = Nullop; + lvalp->opval = NULL; return (char *)s; } @@ -10820,7 +10827,7 @@ S_scan_formline(pTHX_ register char *s) dVAR; register char *eol; register char *t; - SV *stuff = newSVpvs(""); + SV * const stuff = newSVpvs(""); bool needargs = FALSE; bool eofmt = FALSE; @@ -10871,7 +10878,7 @@ S_scan_formline(pTHX_ register char *s) s = filter_gets(PL_linestr, PL_rsfp, 0); PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = SvPVX(PL_linestr); PL_bufend = PL_bufptr + SvCUR(PL_linestr); - PL_last_lop = PL_last_uni = Nullch; + PL_last_lop = PL_last_uni = NULL; if (!s) { s = PL_bufptr; break; @@ -10916,6 +10923,10 @@ S_set_csh(pTHX) dVAR; if (!PL_cshlen) PL_cshlen = strlen(PL_cshname); +#else +#if defined(USE_ITHREADS) + PERL_UNUSED_CONTEXT; +#endif #endif } @@ -10924,7 +10935,7 @@ Perl_start_subparse(pTHX_ I32 is_format, U32 flags) { dVAR; const I32 oldsavestack_ix = PL_savestack_ix; - CV* outsidecv = PL_compcv; + CV* const outsidecv = PL_compcv; if (PL_compcv) { assert(SvTYPE(PL_compcv) == SVt_PVCV); @@ -10933,13 +10944,13 @@ Perl_start_subparse(pTHX_ I32 is_format, U32 flags) save_item(PL_subname); SAVESPTR(PL_compcv); - PL_compcv = (CV*)NEWSV(1104,0); + PL_compcv = (CV*)newSV(0); sv_upgrade((SV *)PL_compcv, is_format ? SVt_PVFM : SVt_PVCV); CvFLAGS(PL_compcv) |= flags; PL_subline = CopLINE(PL_curcop); CvPADLIST(PL_compcv) = pad_new(padnew_SAVE|padnew_SAVESUB); - CvOUTSIDE(PL_compcv) = (CV*)SvREFCNT_inc(outsidecv); + CvOUTSIDE(PL_compcv) = (CV*)SvREFCNT_inc_simple(outsidecv); CvOUTSIDE_SEQ(PL_compcv) = PL_cop_seqmax; return oldsavestack_ix; @@ -11014,7 +11025,7 @@ Perl_yyerror(pTHX_ const char *s) where = "within string"; } else { - SV *where_sv = sv_2mortal(newSVpvs("next char ")); + SV * const where_sv = sv_2mortal(newSVpvs("next char ")); if (yychar < 32) Perl_sv_catpvf(aTHX_ where_sv, "^%c", toCTRL(yychar)); else if (isPRINT_LC(yychar)) @@ -11221,7 +11232,7 @@ vstring, as well as updating the passed in sv. Function must be called like - sv = NEWSV(92,5); + sv = newSV(5); s = scan_vstring(s,sv); The sv should already be large enough to store the vstring