pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:200:    Pike_fatal("Popped out of stack frames.\n");   #endif    POP_PIKE_FRAME();    }      #ifdef PIKE_DEBUG    if(Pike_sp - Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer)    Pike_fatal("Stack error in error.\n");   #endif    -  /* Note: The pop_n_elems below may trigger destruct callbacks being called +  /* Note: The pop_stack() below may trigger destruct callbacks being called    * for objects having PROGRAM_DESTRUCT_IMMEDIATE. These may    * in turn throw (caught) errors and zap throw_value. -  +  * +  * Note: We can not use pop_n_elems() here as a nested error in an +  * immediate destruct callback may zap the stack for us during +  * our popping.    */ -  pop_n_elems(Pike_sp - Pike_interpreter.evaluator_stack - Pike_interpreter.recoveries->stack_pointer); +  while (Pike_sp > Pike_interpreter.evaluator_stack + Pike_interpreter.recoveries->stack_pointer) { +  pop_stack(); +  }    Pike_mark_sp = Pike_interpreter.mark_stack + Pike_interpreter.recoveries->mark_sp;       /* Move the value to be thrown back so that it can be caught. */    free_svalue(&throw_value);    move_svalue(&throw_value, &save_throw_value);      #if defined(DEBUG_MALLOC) && defined(PIKE_DEBUG)    /* This will tell us where the value was caught (I hope) */    if(REFCOUNTED_TYPE(TYPEOF(throw_value)))    {