pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.c:2971:    * n+3 - - Terminate    *    * Note that the above requires an even number of continuation states.    * We therefore add an extra termination state if we have an odd    * number of continuation states.    */    states = count_continue_returns(n);       Pike_compiler->compiler_frame->generator_index = 0;    Pike_compiler->compiler_frame->generator_jumptable = -  xalloc(sizeof(INT32) * (states + (states & 1) + 3)); -  generator_jumptable = xalloc(sizeof(INT32) * (states + (states & 1) + 3)); +  xalloc(2 * sizeof(INT32) * (states + (states & 1) + 3)); +  generator_jumptable = Pike_compiler->compiler_frame->generator_jumptable + +  (states + (states & 1) + 3);       for (e = 0; e < states + (states & 1) + 3; e++) {    generator_jumptable[e] = (INT32)emit1(F_POINTER, 0);    Pike_compiler->compiler_frame->generator_jumptable[e] = -1;    }    emit0(F_NOTREACHED);       /* Termination state. (-1, default) */    Pike_compiler->compiler_frame->generator_jumptable[    Pike_compiler->compiler_frame->generator_index++] = ins_label(-1);
pike.git/src/docode.c:3069:    /* NB: For eg 5 entries (-1, 0, 1, 2, (3)), we need 2 entries in the array    * ({ 0, 2 }).    */    for (e = 0; e < Pike_compiler->compiler_frame->generator_index-1; e += 2) {    push_int(e);    }    f_aggregate(Pike_sp - save_sp);       update_arg(generator_switch, store_constant(Pike_sp - 1, 1, 0));    pop_stack(); +  +  free(Pike_compiler->compiler_frame->generator_jumptable); +  Pike_compiler->compiler_frame->generator_jumptable = NULL;    } else if(Pike_compiler->compiler_frame->recur_label > 0)    {   #ifdef PIKE_DEBUG    if(l_flag)    {    fprintf(stderr,"Generating inline recursive function.\n");    }   #endif    /* generate code again, but this time it is inline */    Pike_compiler->compiler_frame->is_inline=1;