Branch: Tag:

2001-10-03

2001-10-03 22:22:20 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

bugfix for mapping_is_constant

Rev: src/mapping.c:1.123

5:   \*/   /**/   #include "global.h" - RCSID("$Id: mapping.c,v 1.122 2001/09/28 23:18:53 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.123 2001/10/03 22:22:20 hubbe Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"
2336:   int mapping_is_constant(struct mapping *m,    struct processing *p)   { +  int ret=1;    INT32 e;    struct keypair *k;    struct mapping_data *md=m->data;
2346:    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; +  if(!svalues_are_constant(&k->ind, 1, md->ind_types, p) || +  !svalues_are_constant(&k->val, 1, md->val_types, p)) +  { +  ret=0; +  e=md->hashsize; +  break;    } -  +  }    md->valrefs--;    free_mapping_data(md);    } -  return 1; +  return ret;   }