This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Rmv useless code
authorKarl Williamson <khw@cpan.org>
Sat, 25 Mar 2017 23:38:40 +0000 (17:38 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 2 Nov 2017 19:26:10 +0000 (13:26 -0600)
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.

toke.c

diff --git a/toke.c b/toke.c
index d2a1ad2..bbfb6fb 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -5607,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
@@ -5633,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 '-':