pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /* -  * $Id: interpret_functions.h,v 1.102 2002/05/10 23:44:05 nilsson Exp $ +  * $Id: interpret_functions.h,v 1.103 2002/05/11 21:07:59 mast Exp $    *    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST   #undef LOOP   #undef COMPARISON
pike.git/src/interpret_functions.h:2202:       DO_JUMP_TO(addr);   });      OPCODE0(F_BREAKPOINT, "breakpoint", 0, {    extern void o_breakpoint(void);    o_breakpoint();    DO_JUMP_TO(PROG_COUNTER-1);   });    - OPCODE0(F_THIS_OBJECT, "this_object", 0, { + OPCODE1(F_THIS_OBJECT, "this_object", 0, {    if(Pike_fp)    { -  ref_push_object(Pike_fp->current_object); +  struct object *o = Pike_fp->current_object; +  int level = arg1; +  for (; level > 0; level--) { +  struct program *p = o->prog; +  if (!p) +  Pike_error ("Cannot get the parent object of a destructed object.\n"); +  DO_IF_DEBUG ( +  if (!(p->flags & PROGRAM_USES_PARENT)) +  fatal ("optimize_this_object failed to set up parent pointers.\n"); +  ); +  o = PARENT_INFO(o)->parent; +  } +  ref_push_object(o);    }else{ -  +  /* Shouldn't this generate an error? /mast */    push_int(0);    }   });      OPCODE0(F_ZERO_TYPE, "zero_type", 0, {    if(Pike_sp[-1].type != T_INT)    {    if((Pike_sp[-1].type==T_OBJECT || Pike_sp[-1].type==T_FUNCTION)    && !Pike_sp[-1].u.object->prog)    {