Branch: Tag:

2008-05-30

2008-05-30 11:20:44 by Henrik Grubbström (Grubba) <grubba@grubba.org>

It is now possible to return a reference to the current inherit in this object.
The third argument to program_magic_identifier() should now be -1 when no inherit has been specified (0 is now reserved for referring to the current inherit).
This is also reflected in the F_THIS node.
The F_THIS opcode is now used exclusively to refer to specific inherits.
Use the F_THIS_OBJECT opcode to refer to the current object.

Rev: src/docode.c:1.201
Rev: src/interpret_functions.h:1.204
Rev: src/language.yacc:1.426
Rev: src/las.c:1.415
Rev: src/peep.in:1.83
Rev: src/program.c:1.710

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: las.c,v 1.414 2008/05/24 21:45:48 grubba Exp $ + || $Id: las.c,v 1.415 2008/05/30 11:20:44 grubba Exp $   */      #include "global.h"
1215:    node *res;      #ifdef PIKE_DEBUG -  if ((inherit_num < 0) || (inherit_num > 65535)) { +  if ((inherit_num < -1) || (inherit_num > 65535)) {    Pike_fatal("This is bad: %p, %d\n", parent_prog, inherit_num);    }   #endif /* PIKE_DEBUG */
1223:    res = mkemptynode();    res->token = F_THIS;    type_stack_mark(); -  push_object_type(!!inherit_num, parent_prog->inherits[inherit_num].prog->id); +  if (inherit_num >= 0) { +  push_object_type(1, parent_prog->inherits[inherit_num].prog->id); +  } else { +  push_object_type(0, parent_prog->id); +  }    res->type = pop_unfinished_type();    res->tree_info = res->node_info = OPT_NOT_CONST;