pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: error.c,v 1.149 2007/06/16 23:52:52 mast Exp $ + || $Id: error.c,v 1.150 2007/07/04 17:35:42 grubba Exp $   */      #define NO_PIKE_SHORTHAND   #include "global.h"   #include "svalue.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "interpret.h"   #include "stralloc.h"   #include "builtin_functions.h"
pike.git/src/error.c:126:    Pike_interpreter.catch_ctx = cc->prev;    really_free_catch_context (cc);    }       Pike_interpreter.recoveries=Pike_interpreter.recoveries->previous;    }       if(!Pike_interpreter.recoveries)    Pike_fatal("No error recovery context.\n");    - #ifdef PIKE_DEBUG -  if(Pike_sp - Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer) -  Pike_fatal("Stack error in error.\n"); - #endif -  +     while(Pike_fp != Pike_interpreter.recoveries->frame_pointer)    {   #ifdef PIKE_DEBUG    if(!Pike_fp)    Pike_fatal("Popped out of stack frames.\n");   #endif    POP_PIKE_FRAME();    }    -  pop_n_elems(Pike_sp - Pike_interpreter.evaluator_stack - Pike_interpreter.recoveries->stack_pointer); -  Pike_mark_sp = Pike_interpreter.mark_stack + Pike_interpreter.recoveries->mark_sp; +  /* Don't pop the stack before the onerrors have run; they might need +  * items from the stack. +  */       while(Pike_interpreter.recoveries->onerror)    {    (*Pike_interpreter.recoveries->onerror->func)(Pike_interpreter.recoveries->onerror->arg);    Pike_interpreter.recoveries->onerror=Pike_interpreter.recoveries->onerror->previous;    }    -  + #ifdef PIKE_DEBUG +  if(Pike_sp - Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer) +  Pike_fatal("Stack error in error.\n"); + #endif +  +  pop_n_elems(Pike_sp - Pike_interpreter.evaluator_stack - Pike_interpreter.recoveries->stack_pointer); +  Pike_mark_sp = Pike_interpreter.mark_stack + Pike_interpreter.recoveries->mark_sp; +    #if defined(DEBUG_MALLOC) && defined(PIKE_DEBUG)    /* This will tell us where the value was caught (I hope) */    if(throw_value.type <= MAX_REF_TYPE)    {    debug_malloc_update_location(throw_value.u.refs,    Pike_interpreter.recoveries->file);    debug_malloc_touch(throw_value.u.refs);    }   #endif