Branch: Tag:

2006-02-27

2006-02-27 12:07:10 by Martin Stjernholm <mast@lysator.liu.se>

Avoid C stack recursion in catch blocks.

Rev: src/docode.c:1.185
Rev: src/error.c:1.144
Rev: src/interpret.c:1.368
Rev: src/interpret.h:1.165
Rev: src/interpret_functions.h:1.187
Rev: src/pike_embed.c:1.7
Rev: src/pike_error.h:1.37
Rev: src/version.h:1.383

2:   || 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: pike_error.h,v 1.36 2004/11/14 17:44:05 mast Exp $ + || $Id: pike_error.h,v 1.37 2006/02/27 12:07:10 mast Exp $   */      #ifndef PIKE_ERROR_H
115: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    int line;    char *file; +  int on_stack;   #endif   } JMP_BUF;   
144:   #define PERR_LOCATION() ( __FILE__ ":" DEFINETOSTR(__LINE__) )   #endif    - #define DEBUG_LINE_ARGS ,char *location - #define SETJMP(X) LOW_SETJMP((init_recovery(&X, 0, PERR_LOCATION())->recovery)) + #define DEBUG_INIT_REC_ARGS , int on_stack, char *location + #define SETJMP(X) LOW_SETJMP((init_recovery(&X, 0, 1, PERR_LOCATION())->recovery))   #define SETJMP_SP(jmp, stack_pop_levels) \ -  LOW_SETJMP((init_recovery(&jmp, stack_pop_levels, PERR_LOCATION())->recovery)) - #else - #define DEBUG_LINE_ARGS +  LOW_SETJMP((init_recovery(&jmp, stack_pop_levels, 1, PERR_LOCATION())->recovery)) + #else /* !PIKE_DEBUG */ + #define DEBUG_INIT_REC_ARGS   #define SETJMP(X) LOW_SETJMP((init_recovery(&X, 0)->recovery))   #define SETJMP_SP(jmp, stack_pop_levels) \    LOW_SETJMP((init_recovery(&jmp, stack_pop_levels)->recovery))   #define UNSETJMP(X) Pike_interpreter.recoveries=X.previous - #endif + #endif /* !PIKE_DEBUG */         #ifdef PIKE_DEBUG
235:   /* Prototypes begin here */   PMOD_EXPORT void check_recovery_context(void);   PMOD_EXPORT void pike_gdb_breakpoint(INT32 args); - PMOD_EXPORT JMP_BUF *init_recovery(JMP_BUF *r, size_t stack_pop_levels DEBUG_LINE_ARGS); + PMOD_EXPORT JMP_BUF *init_recovery(JMP_BUF *r, size_t stack_pop_levels DEBUG_INIT_REC_ARGS);   PMOD_EXPORT DECLSPEC(noreturn) void pike_throw(void) ATTRIBUTE((noreturn));   PMOD_EXPORT void push_error(const char *description);   PMOD_EXPORT DECLSPEC(noreturn) void low_error(const char *buf) ATTRIBUTE((noreturn));