Branch: Tag:

2001-09-28

2001-09-28 23:18:56 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

fix for [bug 1858 (#1858)] (this_object() in constants) and [bug 721 (#721)] (bug with final and inherit) backported from Pike 7.3

Rev: src/array.c:1.104
Rev: src/array.h:1.32
Rev: src/compilation.h:1.22
Rev: src/mapping.c:1.122
Rev: src/mapping.h:1.36
Rev: src/multiset.c:1.33
Rev: src/multiset.h:1.17
Rev: src/program.c:1.304
Rev: src/svalue.c:1.104
Rev: src/svalue.h:1.77

24:   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.103 2001/06/26 12:42:02 grubba Exp $"); + RCSID("$Id: array.c,v 1.104 2001/09/28 23:18:51 hubbe Exp $");      PMOD_EXPORT struct array empty_array=   {
1550:    }   }    - int check_that_array_is_constant(struct array *a) + int array_is_constant(struct array *a, +  struct processing *p)   {    array_fix_type_field(a); -  if(a->type_field & (BIT_FUNCTION | BIT_OBJECT)) -  { -  int e; -  for(e=0;e<a->size;e++) -  { -  switch(ITEM(a)[e].type) -  { -  case T_FUNCTION: -  if(ITEM(a)[e].subtype == FUNCTION_BUILTIN) continue; -  /* Fall through */ -  case T_OBJECT: -  if(ITEM(a)[e].u.object -> next == ITEM(a)[e].u.object) -  { -  /* This is a fake object used during the -  * compilation! -  */ -  return 0; +  return svalues_are_constant(ITEM(a), +  a->size, +  a->type_field, +  p);   } -  } -  } -  } -  return 1; - } +     -  +    node *make_node_from_array(struct array *a)   {    struct svalue s;
1630:    mksvaluenode(ITEM(a))));    }    -  if(check_that_array_is_constant(a)) +  if(array_is_constant(a,0))    {    s.type=T_ARRAY;    s.subtype=0;