Branch: Tag:

2001-01-10

2001-01-10 19:56:37 by Martin Stjernholm <mast@lysator.liu.se>

Added F_ESCAPE_CATCH opcode and extended the return value from
eval_instruction to implement it.

Rev: src/interpret.c:1.179
Rev: src/interpret_functions.h:1.37

5:   \*/   /**/   #include "global.h" - RCSID("$Id: interpret.c,v 1.178 2000/12/05 21:08:18 per Exp $"); + RCSID("$Id: interpret.c,v 1.179 2001/01/10 19:56:37 mast Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
755:   static int o_catch(unsigned char *pc);      #ifdef PIKE_DEBUG + #define EVAL_INSTR_RET_CHECK(x) \ +  if (x == -2) \ +  fatal("Return value -2 from eval_instruction is not handled here.\n"\ +  "Probable cause: F_ESCAPE_CATCH outside catch block.\n") + #else + #define EVAL_INSTR_RET_CHECK(x) + #endif +  + #ifdef PIKE_DEBUG   #define eval_instruction eval_instruction_with_debug   #include "interpreter.h"   
1298:    {    struct svalue **save_mark_sp=Pike_mark_sp;    tailrecurse=eval_instruction(pc); +  EVAL_INSTR_RET_CHECK(tailrecurse);    Pike_mark_sp=save_mark_sp;   #ifdef PIKE_DEBUG    if(Pike_mark_sp < save_mark_sp)
1437:   #endif    Pike_mark_sp=save_mark_sp;    Pike_fp->expendible=expendible; -  if(x!=-1) mega_apply(APPLY_STACK, x, 0,0); +  if(x>=0) mega_apply(APPLY_STACK, x, 0,0);    UNSETJMP(tmp); -  return 1; +  return x == -2 ? 2 : 1;    }   }   
1496:    }else{    struct svalue **save_mark_sp=Pike_mark_sp;    int tmp=eval_instruction(o->prog->program + offset); +  EVAL_INSTR_RET_CHECK(tmp);    Pike_mark_sp=save_mark_sp; -  if(tmp!=-1) mega_apply(APPLY_STACK, tmp, 0,0); +  if(tmp>=0) mega_apply(APPLY_STACK, tmp, 0,0);      #ifdef PIKE_DEBUG    if(Pike_sp<Pike_interpreter.evaluator_stack)