pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:3565:   }      /* frame_execute will perform the actual function call. */   void frame_execute(const struct pike_frame * frame) {    struct svalue *save_sp = frame->save_sp;    enum frame_type type = frame->type;      #ifdef PIKE_DEBUG    frame_check_all(frame);    assert(frame == Pike_fp); +  assert(frame->type != FRAME_FREE); +  assert(frame->type != FRAME_BUILTIN);   #endif       FAST_CHECK_THREADS_ON_CALL();       switch (type) {    case FRAME_EFUN:    case FRAME_C_FUNCTION: {    void (*fun)(INT32) = frame->ptr;    fun(frame->num_args);    break;
pike.git/src/interpret.c:3626:    apply_array(a, frame->num_args, 0);    break;    }    case FRAME_CAST: {    // o_cast    struct pike_type * type = frame->ptr;    TYPE_T t = PTR_TO_INT(frame->pc);    o_cast(type, t);    break;    } -  case FRAME_BUILTIN: -  Pike_fatal("Cannot execute builtin frame.\n"); +     default: - #ifdef PIKE_DEBUG -  Pike_fatal("trying to execute uninitialized frame.\n"); - #else +     UNREACHABLE(return); - #endif +     }      #ifdef PIKE_DEBUG    frame_check_all(frame);    assert(frame == Pike_fp);   #endif       if (type == FRAME_C_FUNCTION) {    if(UNLIKELY(Pike_interpreter.trace_level>1))    do_trace_func_return (1, frame->current_object, frame->fun);
pike.git/src/interpret.c:3754:   #endif   }      struct pike_frame * frame_return(struct pike_frame *frame) {    struct svalue *save_sp = frame->save_sp+1;    struct pike_frame *new_frame;      #ifdef PIKE_DEBUG    frame_check_all(Pike_fp);    assert (Pike_fp == frame); +  assert (frame->type != FRAME_FREE); +  assert (frame->type != FRAME_BUILTIN);   #endif       if (frame->refs > 1) {    new_frame = frame_init();    *new_frame = *frame;       new_frame->refs = 1;    -  if (new_frame->current_object) add_ref(new_frame->current_object); -  if (new_frame->current_program) add_ref(new_frame->current_program); + #ifdef PIKE_DEBUG +  assert (frame->current_object); +  assert (frame->current_program); + #endif +  if (new_frame->scope) add_ref(new_frame->scope); +  add_ref(new_frame->current_object); +  add_ref(new_frame->current_program);       frame->refs --;       frame_unlink(frame);       Pike_fp = new_frame;    } else {    // TODO: profiling       new_frame = frame;