Branch: Tag:

2001-01-11

2001-01-11 23:28:30 by Martin Stjernholm <mast@lysator.liu.se>

Fixed proper error recovery in the RECUR opcodes where the pike_frame is
changed destructively.

Test case: The following program should loop infinitely and not segfault
when the stack is eaten (running with -d necessary).

int main()
{
int i = 5;
catch(main());
return main() + i;
}

Rev: src/interpret.c:1.180
Rev: src/interpret_functions.h:1.38
Rev: src/interpreter.h:1.54

5:   \*/   /**/   #include "global.h" - RCSID("$Id: interpret.c,v 1.179 2001/01/10 19:56:37 mast Exp $"); + RCSID("$Id: interpret.c,v 1.180 2001/01/11 23:28:30 mast Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
754:   #endif   static int o_catch(unsigned char *pc);    + struct light_frame_info + { +  struct svalue *expendible; +  struct svalue *locals; + }; +  + static void restore_light_frame_info(struct light_frame_info *info) + { +  Pike_fp->expendible = info->expendible; +  Pike_fp->locals = info->locals; + } +    #ifdef PIKE_DEBUG   #define EVAL_INSTR_RET_CHECK(x) \    if (x == -2) \