X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=toke.c;h=4b65d6244b68c0eca53fdf99f2c2d328bdf0d0cc;hb=9f07fdcd4d463e2090de7661b6a313c8ecc5278b;hp=e75d878c31e3db843380a0fb38ab7b39f1883fec;hpb=d2560b705d852dbc96fd94b95faaa076758b7a8c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/toke.c b/toke.c index e75d878..4b65d62 100644 --- a/toke.c +++ b/toke.c @@ -357,7 +357,6 @@ Perl_lex_start(pTHX_ SV *line) SAVEVPTR(PL_nextval[toke]); } SAVEI32(PL_nexttoke); - PL_nexttoke = 0; } SAVECOPLINE(PL_curcop); SAVEPPTR(PL_bufptr); @@ -391,6 +390,7 @@ Perl_lex_start(pTHX_ SV *line) PL_lex_stuff = Nullsv; PL_lex_repl = Nullsv; PL_lex_inpat = 0; + PL_nexttoke = 0; PL_lex_inwhat = 0; PL_sublex_info.sub_inwhat = 0; PL_linestr = line; @@ -812,7 +812,7 @@ Perl_str_to_version(pTHX_ SV *sv) I32 skip; UV n; if (utf) - n = utf8_to_uv((U8*)start, &skip, 0); + n = utf8_to_uv_chk((U8*)start, &skip, 0); else { n = *(U8*)start; skip = 1; @@ -1323,7 +1323,7 @@ S_scan_const(pTHX_ char *start) /* (now in tr/// code again) */ if (*s & 0x80 && thisutf) { - (void)utf8_to_uv((U8*)s, &len, 0); + (void)utf8_to_uv_chk((U8*)s, &len, 0); if (len == 1) { /* illegal UTF8, make it valid */ char *old_pvx = SvPVX(sv); @@ -1489,7 +1489,10 @@ S_scan_const(pTHX_ char *start) char *ostart = SvPVX(sv); SvCUR_set(sv, d - ostart); SvPOK_on(sv); + *d = '\0'; sv_utf8_upgrade(sv); + /* this just broke our allocation above... */ + SvGROW(sv, send - start); d = SvPVX(sv) + SvCUR(sv); has_utf = TRUE; }