In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/5ffd609608e2a003d9a229e7cd0ba1f883c53ade?hp=576915daebd987c8149486c51d8423a1dd471ded>
- Log ----------------------------------------------------------------- commit 5ffd609608e2a003d9a229e7cd0ba1f883c53ade Author: Karl Williamson <[email protected]> Date: Sat Mar 25 17:38:40 2017 -0600 toke.c: Rmv useless code This code is unreachable because the code above makes sure that the variable can't be larger than PL_bufend, and the code is only executed if it is larger. commit 76dafe0b21a330026314b29e7392fe294b9af9e0 Author: Karl Williamson <[email protected]> Date: Sat Mar 25 15:18:27 2017 -0600 toke.c: White space only Fix up some white space, including outdenting a block that was doubly indented ----------------------------------------------------------------------- Summary of changes: toke.c | 73 ++++++++++++++++++++++++++++++------------------------------------ 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/toke.c b/toke.c index a8578e6975..bbfb6fb717 100644 --- a/toke.c +++ b/toke.c @@ -5294,9 +5294,10 @@ Perl_yylex(pTHX) sv_catpvs(PL_linestr,"chomp;"); if (PL_minus_a) { if (PL_minus_F) { - if ((*PL_splitstr == '/' || *PL_splitstr == '\'' - || *PL_splitstr == '"') - && strchr(PL_splitstr + 1, *PL_splitstr)) + if ( ( *PL_splitstr == '/' + || *PL_splitstr == '\'' + || *PL_splitstr == '"') + && strchr(PL_splitstr + 1, *PL_splitstr)) Perl_sv_catpvf(aTHX_ PL_linestr, "our @F=split(%s);", PL_splitstr); else { /* "q\0${splitstr}\0" is legal perl. Yes, even NUL @@ -5346,10 +5347,10 @@ Perl_yylex(pTHX) /* If it looks like the start of a BOM or raw UTF-16, * check if it in fact is. */ if (bof && PL_rsfp - && (*s == 0 + && ( *s == 0 || *(U8*)s == BOM_UTF8_FIRST_BYTE - || *(U8*)s >= 0xFE - || s[1] == 0)) + || *(U8*)s >= 0xFE + || s[1] == 0)) { Off_t offset = (IV)PerlIO_tell(PL_rsfp); bof = (offset == (Off_t)SvCUR(PL_linestr)); @@ -5606,10 +5607,6 @@ Perl_yylex(pTHX) d++; if (d < PL_bufend) d++; - else if (d > PL_bufend) - /* Found by Ilya: feed random input to Perl. */ - Perl_croak(aTHX_ "panic: input overflow, %p > %p", - d, PL_bufend); s = d; if (in_comment && d == PL_bufend && PL_lex_state == LEX_INTERPNORMAL @@ -5632,9 +5629,6 @@ Perl_yylex(pTHX) if (s < PL_bufend) incline(s); } - else if (s > PL_bufend) - /* Found by Ilya: feed random input to Perl. */ - Perl_croak(aTHX_ "panic: input overflow"); } goto retry; case '-': @@ -6428,8 +6422,9 @@ Perl_yylex(pTHX) && isALPHA(tmp) && (s == PL_linestart+1 || s[-2] == '\n') ) { - if ((PL_in_eval && !PL_rsfp && !PL_parser->filtered) - || PL_lex_state != LEX_NORMAL) { + if ( (PL_in_eval && !PL_rsfp && !PL_parser->filtered) + || PL_lex_state != LEX_NORMAL) + { d = PL_bufend; while (s < d) { if (*s++ == '\n') { @@ -6686,28 +6681,28 @@ Perl_yylex(pTHX) PL_tokenbuf[0] = '%'; if (strEQ(PL_tokenbuf+1, "SIG") && ckWARN(WARN_SYNTAX) && (t = strchr(s, '}')) && (t = strchr(t, '='))) - { - char tmpbuf[sizeof PL_tokenbuf]; - do { - t++; - } while (isSPACE(*t)); - if (isIDFIRST_lazy_if_safe(t, PL_bufend, UTF)) { - STRLEN len; - t = scan_word(t, tmpbuf, sizeof tmpbuf, TRUE, - &len); - while (isSPACE(*t)) - t++; - if ( *t == ';' - && get_cvn_flags(tmpbuf, len, UTF - ? SVf_UTF8 - : 0)) - { - Perl_warner(aTHX_ packWARN(WARN_SYNTAX), - "You need to quote \"%" UTF8f "\"", - UTF8fARG(UTF, len, tmpbuf)); - } - } - } + { + char tmpbuf[sizeof PL_tokenbuf]; + do { + t++; + } while (isSPACE(*t)); + if (isIDFIRST_lazy_if_safe(t, PL_bufend, UTF)) { + STRLEN len; + t = scan_word(t, tmpbuf, sizeof tmpbuf, TRUE, + &len); + while (isSPACE(*t)) + t++; + if ( *t == ';' + && get_cvn_flags(tmpbuf, len, UTF + ? SVf_UTF8 + : 0)) + { + Perl_warner(aTHX_ packWARN(WARN_SYNTAX), + "You need to quote \"%" UTF8f "\"", + UTF8fARG(UTF, len, tmpbuf)); + } + } + } } } @@ -9920,9 +9915,7 @@ S_scan_heredoc(pTHX_ char *s) if (! isWORDCHAR_lazy_if_safe(s, PL_bufend, UTF)) Perl_croak(aTHX_ "Use of bare << to mean <<\"\" is forbidden"); peek = s; - while ( - isWORDCHAR_lazy_if_safe(peek, PL_bufend, UTF)) - { + while (isWORDCHAR_lazy_if_safe(peek, PL_bufend, UTF)) { peek += UTF ? UTF8SKIP(peek) : 1; } len = (peek - s >= e - d) ? (e - d) : (peek - s); -- Perl5 Master Repository
