• Father Chrysostomos's avatar
    eval {label:} crash · 4c88d9ce
    Father Chrysostomos authored
    As of v5.13.6-130-geae48c8, the block consists solely of a
    nextstate op.
    
    The code in ck_eval that distinguished between eval-block and eval-
    string was checking the type of the kid op (looking for lineseq or
    stub) instead of simply checking the type of the op itself (entertry/
    entereval).
    
    The lexer was already making the distinction between the two but op.c
    was ignoring the information provided by the lexer.
    
    Usually
    
      entertry(unop)
        kid
    
    gets converted into
    
      leavetry
        entertry(logop)
        kid
    
    with the entertry reallocated as a larger-sized op, but that was not
    happening.  The peephole optimiser assumed it had happened, and fol-
    lowed the cLOGOPo->op_other pointer, which is unrelated junk beyond
    the end of the unop struct.  Hence the crash.
    (cherry picked from commit 2f465e08eb39981706429873d24e3bcc18015bfb)
    
    Bug: https://rt.perl.org/Ticket/Display.html?id=123652
    Bug-Debian: https://bugs.debian.org/822336
    Patch-Name: fixes/5.20.3/eval_label_crash.diff
    4c88d9ce