Branch: Tag:

2006-03-07

2006-03-07 20:12:00 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fix for F_CATCH on architectures where ENTRY_PROLOGUE_SIZE is non-zero.

Rev: src/interpret_functions.h:1.188

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_functions.h,v 1.187 2006/02/27 12:07:10 mast Exp $ + || $Id: interpret_functions.h,v 1.188 2006/03/07 20:12:00 grubba Exp $   */      /*
1279:    init_recovery (&new_catch_ctx->recovery, 0);    );    new_catch_ctx->save_expendible = Pike_fp->expendible; -  new_catch_ctx->continue_reladdr = GET_JUMP(); +     JUMP_SET_TO_PC_AT_NEXT (addr); -  +  new_catch_ctx->continue_reladdr = GET_JUMP();    new_catch_ctx->next_addr = addr;    new_catch_ctx->prev = Pike_interpreter.catch_ctx;    Pike_interpreter.catch_ctx = new_catch_ctx;
1288:       Pike_fp->expendible = Pike_fp->locals + Pike_fp->num_locals;    +  /* Need to adjust next_addr by sizeof(INT32) to skip past the jump +  * address to the continue position after the catch block. */ +  addr = (PIKE_OPCODE_T *) ((INT32 *) addr + 1); +     if (Pike_interpreter.catching_eval_jmpbuf) {    /* There's already a catching_eval_instruction around our    * eval_instruction, so we can just continue. */    debug_malloc_touch_named (Pike_interpreter.catch_ctx, "(1)"); -  SKIPJUMP(); + #ifdef ENTRY_PROLOGUE_SIZE +  /* We also need to skip past the entry prologue... */ +  addr += ENTRY_PROLOGUE_SIZE; + #endif +  SET_PROG_COUNTER(addr); +  FETCH; +  JUMP_DONE;    }       else {    debug_malloc_touch_named (Pike_interpreter.catch_ctx, "(2)");    check_c_stack(8192);    -  /* Need to adjust next_addr by sizeof(INT32) to skip past the jump -  * address to the continue position after the catch block. */ -  addr = (PIKE_OPCODE_T *) ((INT32 *) addr + 1); -  +     while (1) {    /* Loop here every time an exception is caught. Once we've    * gotten here and set things up to run eval_instruction from
1815:   });      OPCODE1(F_POS_INT_INDEX, "int index", 0, { -  push_int(arg1); +  push_int((ptrdiff_t)(int)arg1);    print_return_value();    DO_INDEX;   });