Ticket #1009: exit_null.patch

File exit_null.patch, 1.4 KB (added by NotFound, 5 years ago)
  • src/pmc/continuation.pmc

     
    187187        cc->address    = pos; 
    188188        cc->runloop_id = INTERP->current_runloop_id; 
    189189 
    190         if (pos && (*pos == PARROT_OP_get_results_pc)) 
     190        if (pos && ((pos <= (cc->seg->base.data + cc->seg->base.size)) &&(*pos == PARROT_OP_get_results_pc))) 
    191191            cc->current_results = pos; 
    192192        else 
    193193            cc->current_results = NULL; 
  • compilers/imcc/pcc.c

     
    447447        IMCC_debug(interp, DEBUG_IMC, "add sub ret - %I\n", tmp); 
    448448        insert_ins(unit, unit->last_ins, tmp); 
    449449    } 
    450     else if (STREQ(unit->last_ins->opname, "exit")) { 
    451         /* C<exit> builds RetContinuation pointing to next op_code. So insert some */ 
    452         Instruction *tmp = INS(interp, unit, "noop", NULL, regs, 0, 0, 0); 
    453         insert_ins(unit, unit->last_ins, tmp); 
    454     } 
    455450} 
    456451 
    457452/* 
  • t/compilers/imcc/imcpasm/opt0.t

     
    8686_test: 
    8787  noop 
    8888  exit 0 
    89   noop 
    9089OUT 
    9190 
    9291##############################