pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:3591:    SET_ONERROR (uwp, restore_catching_eval_jmpbuf, saved_jmpbuf);       eval_instruction(pc   #ifdef ENTRY_PROLOGUE_SIZE    - ENTRY_PROLOGUE_SIZE   #endif /* ENTRY_PROLOGUE_SIZE */    );       CALL_AND_UNSET_ONERROR(uwp);    +  // NOTE: we need to update the frame, since +  // tail recursion might have replaced it +  frame = Pike_fp; +     break;    }    case FRAME_PARENT_CLONE: {    struct program *p = frame->ptr;    struct object *parent = frame->current_object;    push_object(parent_clone_object(p, parent, frame->fun, frame->num_args));    break;    }    case FRAME_CLONE: {    struct program *p = frame->ptr;
pike.git/src/interpret.c:3625:    }    case FRAME_BUILTIN:    Pike_fatal("Cannot execute builtin frame.\n");   #ifdef PIKE_DEBUG    default:    Pike_fatal("trying to execute uninitialized frame.\n");   #endif    }      #ifdef PIKE_DEBUG -  frame_check_all(Pike_fp); - #endif -  -  if (save_sp+1 > Pike_sp) { -  //fprintf(stderr, "function did not return.\n"); -  push_int(0); -  } else { -  if (save_sp+1 < Pike_sp) { -  //fprintf(stderr, "function left %d items on the stack\n", (int)(Pike_sp - save_sp - 1)); -  assign_svalue(save_sp,Pike_sp-1); -  pop_n_elems(Pike_sp-save_sp-1); -  /* consider using a flag for immediate destruct instead... */ -  low_destruct_objects_to_destruct(); -  } -  } -  -  if (type == FRAME_PIKE_FUNCTION) return; -  - #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);    } else if (type == FRAME_CLONE || type == FRAME_PARENT_CLONE) {    if(UNLIKELY(Pike_interpreter.trace_level>1))    do_trace_func_return (1, NULL, 0);
pike.git/src/interpret.c:3792: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    new_frame->locals = new_frame->expendible = new_frame->save_sp = NULL;    new_frame->args = new_frame->num_args = new_frame->num_locals = 0;   #endif       if (frame->type == FRAME_PIKE_FUNCTION) {    Pike_mark_sp = frame->save_mark_sp;    }    // pop all locals +  if (save_sp > Pike_sp) { +  push_int(0); +  } else {    stack_pop_n_elems_keep_top (Pike_sp - save_sp); -  +  }       {    /* consider using a flag for immediate destruct instead... */    extern struct object *objects_to_destruct;    if( objects_to_destruct )    destruct_objects_to_destruct();    }       return new_frame;   }
pike.git/src/interpret.c:3839:       Pike_fp = frame->next;       if (frame->refs > 1) {    frame->refs --;    frame_unlink(frame);    } else {    really_free_pike_frame(frame);    }    +  if (save_sp > Pike_sp) { +  push_int(0); +  } else {    stack_pop_n_elems_keep_top (Pike_sp - save_sp); -  +  }          {    /* consider using a flag for immediate destruct instead... */    extern struct object *objects_to_destruct;    if( objects_to_destruct ) {   #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR)    /* If the function that returns is the only ref to the current    * object and its program then the program would be freed in    * destruct_objects_to_destruct below. However, we're still