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

5:   \*/   /**/   #include "global.h" - RCSID("$Id: mapping.c,v 1.137 2001/09/24 14:44:47 grubba Exp $"); + RCSID("$Id: mapping.c,v 1.138 2001/09/25 05:55:10 hubbe Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"
1726:       mapping_fix_type_field(m);    -  if((m->data->ind_types | m->data->val_types) & (BIT_FUNCTION | BIT_OBJECT)) +  if(!mapping_is_constant(m,0))    {    struct array *ind, *val;    node *n;
2457:    }   }    + int mapping_is_constant(struct mapping *m, +  struct processing *p) + { +  INT32 e; +  struct keypair *k; +  struct mapping_data *md=m->data; +  +  if( (md->ind_types | md->val_types) & ~(BIT_INT|BIT_FLOAT|BIT_STRING)) +  { +  md->valrefs++; +  add_ref(md); +  NEW_MAPPING_LOOP(md) +  { +  if(!svalues_are_constant(&k->ind, 1, md->ind_types, p)) return 0; +  if(!svalues_are_constant(&k->val, 1, md->val_types, p)) return 0; +  } +  md->valrefs--; +  free_mapping_data(md); +  } +  return 1; + }