pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.c:2503: Inside #if defined(PIKE_DEBUG)
   /* Use the ordinary pop mark instruction here since we know    * the stack isn't in synch and we don't want debug checks    * for that. */    do_pop_mark (NULL);    }   #endif    }    }       if (Pike_compiler->compiler_frame->generator_local != -1) { +  emit1(F_SAVE_STACK, Pike_compiler->compiler_frame->generator_local + 1);    if (CDR(n) && CDR(n)->u.sval.u.integer) {    /* Continue return. */    continue_label = alloc_label();    /* NB: Subtract 1 to compensate for starting cases at -1. */    emit1(F_NUMBER,    Pike_compiler->compiler_frame->generator_index-1);    } else {    emit1(F_NUMBER, -1);    }    emit1(F_ASSIGN_LOCAL_AND_POP,    Pike_compiler->compiler_frame->generator_local);    }       emit0(in_catch ? F_VOLATILE_RETURN : F_RETURN);       if (continue_label != -1) { -  +  modify_stack_depth(-1);    Pike_compiler->compiler_frame->generator_jumptable[    Pike_compiler->compiler_frame->generator_index++] =    ins_label(continue_label);    }    return 0;    }       case F_SSCANF:    tmp1=do_docode(CAR(n),DO_NOT_COPY);    tmp2=do_docode(CDR(n),DO_NOT_COPY | DO_LVALUE);
pike.git/src/docode.c:2942:    init_bytecode();    label_no=1;       /* NOTE: This is no ordinary label... */    low_insert_label(0);    emit0(F_ENTRY);    emit0(F_START_FUNCTION);       if (Pike_compiler->compiler_frame->generator_local != -1) {    INT32 e, states; +  +  /* Zap any initial junk on the stack. */ +  emit1(F_MARK_AT, 0); +  emit0(F_POP_TO_MARK); +  +  /* Restore the stack content and zap extra references. */ +  emit1(F_LOCAL, Pike_compiler->compiler_frame->generator_local + 1); +  emit0(F_PUSH_ARRAY_AND_CLEAR); +     /* Emit the state-machine switch for the generator. */    emit1(F_LOCAL, Pike_compiler->compiler_frame->generator_local);    generator_switch = emit1(F_SWITCH, 0);    emit1(F_ALIGN, sizeof(INT32));       /* NB: Three implicit states:    * -1: return UNDEFINED; // Termination state.    * 0: code // Code start.    * ...    * *: return UNDEFINED; // Termination state (again).