Branch: Tag:

2001-09-25

2001-09-25 05:55:13 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

fix for [bug 1858 (#1858)] (this_object() in constants)

Rev: src/array.c:1.119
Rev: src/array.h:1.38
Rev: src/mapping.c:1.138
Rev: src/mapping.h:1.40
Rev: src/multiset.c:1.39
Rev: src/multiset.h:1.19
Rev: src/program.c:1.373
Rev: src/svalue.c:1.125
Rev: src/svalue.h:1.97

23:   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.118 2001/09/24 14:21:10 grubba Exp $"); + RCSID("$Id: array.c,v 1.119 2001/09/25 05:55:09 hubbe Exp $");      PMOD_EXPORT struct array empty_array=   {
1582:    }   }    - 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)   {
1666:    mksvaluenode(ITEM(a))));    }    -  if(check_that_array_is_constant(a)) +  if(array_is_constant(a,0))    {    debug_malloc_touch(a);    s.type=T_ARRAY;