Branch: Tag:

2008-04-12

2008-04-12 16:18:17 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed issue with restoration of Pike_fp on error via mega_apply().

Rev: src/interpret.c:1.394

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: interpret.c,v 1.393 2008/03/29 16:14:46 mast Exp $ + || $Id: interpret.c,v 1.394 2008/04/12 16:18:17 grubba Exp $   */      #include "global.h"
2176:      PMOD_EXPORT void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2)   { -  /* The C stack margin is normally 8 kb, but if we get here during a -  * lowered margin then don't fail just because of that, unless it's -  * practically zero. */ -  check_c_stack(Pike_interpreter.c_stack_margin ? -  Pike_interpreter.c_stack_margin : 100); -  -  if(low_mega_apply(type, args, arg1, arg2)) -  { +     /* Save and clear Pike_interpreter.catching_eval_jmpbuf so that the    * following eval_instruction will install a LOW_JMP_BUF of its    * own to handle catches. */
2192:    Pike_interpreter.catching_eval_jmpbuf = NULL;    SET_ONERROR (uwp, restore_catching_eval_jmpbuf, saved_jmpbuf);    +  /* The C stack margin is normally 8 kb, but if we get here during a +  * lowered margin then don't fail just because of that, unless it's +  * practically zero. */ +  check_c_stack(Pike_interpreter.c_stack_margin ? +  Pike_interpreter.c_stack_margin : 100); +  +  if(low_mega_apply(type, args, arg1, arg2)) +  {    eval_instruction(Pike_fp->pc   #ifdef ENTRY_PROLOGUE_SIZE    - ENTRY_PROLOGUE_SIZE   #endif /* ENTRY_PROLOGUE_SIZE */    );    low_return(); -  -  Pike_interpreter.catching_eval_jmpbuf = saved_jmpbuf; -  UNSET_ONERROR (uwp); +     } -  +  CALL_AND_UNSET_ONERROR(uwp);   }      /* Put catch outside of eval_instruction, so the setjmp won't affect