pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /*   || 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.151 2003/06/30 17:06:09 mast Exp $ + || $Id: interpret_functions.h,v 1.152 2003/08/03 00:56:46 mast Exp $   */      /*    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST
pike.git/src/interpret_functions.h:359:    });   });      OPCODE2_TAIL(F_MARK_AND_EXTERNAL, "mark & external", 0, {    *(Pike_mark_sp++)=Pike_sp;       OPCODE2(F_EXTERNAL,"external", 0, {    struct external_variable_context loc;       loc.o=Pike_fp->current_object; -  if(!loc.o->prog) -  Pike_error("Cannot access parent of destructed object.\n"); -  +     loc.parent_identifier=Pike_fp->fun; -  loc.inherit=INHERIT_FROM_INT(loc.o->prog, Pike_fp->fun); -  +  if (loc.o->prog) +  loc.inherit=INHERIT_FROM_INT(loc.o->prog, loc.parent_identifier);    find_external_context(&loc, arg2);       DO_IF_DEBUG({    TRACE((5,"- Identifier=%d Offset=%d\n",    arg1,    loc.inherit->identifier_level));    });    -  +  if (arg1 == IDREF_MAGIC_THIS) +  /* Special treatment to allow doing Foo::this on destructed +  * parent objects. */ +  ref_push_object (loc.o); +  else {    low_object_index_no_free(Pike_sp,    loc.o,    arg1 + loc.inherit->identifier_level);    Pike_sp++; -  +  }    print_return_value();    });   });         OPCODE2(F_EXTERNAL_LVALUE, "& external", 0, {    struct external_variable_context loc;       loc.o=Pike_fp->current_object; -  if(!loc.o->prog) -  Pike_error("Cannot access parent of destructed object.\n"); -  +     loc.parent_identifier=Pike_fp->fun; -  loc.inherit=INHERIT_FROM_INT(loc.o->prog, Pike_fp->fun); -  +  if (loc.o->prog) +  loc.inherit=INHERIT_FROM_INT(loc.o->prog, loc.parent_identifier);    find_external_context(&loc, arg2);    -  +  if (!loc.o->prog) +  Pike_error ("Cannot access variable in destructed parent object.\n"); +     DO_IF_DEBUG({    TRACE((5,"- Identifier=%d Offset=%d\n",    arg1,    loc.inherit->identifier_level));    });    -  +     ref_push_object(loc.o);    Pike_sp->type=T_OBJ_INDEX;    Pike_sp->u.integer=arg1 + loc.inherit->identifier_level;    Pike_sp++;   });      OPCODE1(F_MARK_AND_LOCAL, "mark & local", 0, {    *(Pike_mark_sp++) = Pike_sp;    push_svalue( Pike_fp->locals + arg1);    print_return_value();
pike.git/src/interpret_functions.h:2264:    DONE;   });      OPCODE0(F_BREAKPOINT, "breakpoint", 0, {    extern void o_breakpoint(void);    o_breakpoint();    DO_JUMP_TO(PROG_COUNTER-1);   });      OPCODE1(F_THIS_OBJECT, "this_object", 0, { -  if(Pike_fp) -  { +     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))    Pike_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)    {    pop_stack();    push_int(NUMBER_DESTRUCTED);