• Father Chrysostomos's avatar
    Fix hang with "@{" · 34a34cb6
    Father Chrysostomos authored
    Commit v5.21.8-320-ge47d32d stopped code interpolated into quote-like
    operators from reading more lines of input, by making lex_next_chunk
    ignore the open filehandle and return false.  That causes this block
    under case 0 in yylex to loop:
    
    	    if (!lex_next_chunk(fake_eof)) {
    		CopLINE_dec(PL_curcop);
    		s = PL_bufptr;
    		TOKEN(';');	/* not infinite loop because rsfp is NULL now */
    	    }
    
    (rsfp is not null there.)  This commit makes it check for quote-like
    operators above, in the same place where it checks whether the file is
    open, to avoid falling through to this code that can loop.
    
    This changes the syntax errors for a couple of cases recently added
    to t/op/lex.t, though I think the error output is now more consis-
    tent overall.
    
    (cherry picked from commit 0f9d53bbcafba2b30e50a1ad22c7759be170e14a)
    
    https://rt.perl.org/Ticket/Display.html?id=123893
    Bug-Debian: https://bugs.debian.org/822336
    Patch-Name: fixes/5.20.3/yylex_loop.diff
    34a34cb6