Branch: Tag:

2022-05-07

2022-05-07 18:59:41 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: Support multiple store in store_marker().

3938:   static void store_marker(struct remap_state *remap, int marker,    struct pike_type *value, enum pt_remap_flags flags)   { -  struct svalue key, val; +  struct svalue key, val, *old; +  struct pike_type *both = NULL;    int marker_set = !!(flags & PT_FLAG_REMAP_SWAP_MARKERS);       if (!remap || !marker) return;
3948:    }       SET_SVAL(key, T_INT, NUMBER_NUMBER, integer, marker); +  old = low_mapping_lookup(remap->markers[marker_set], &key);    if (value) { -  +  if (old && (TYPEOF(*old) == T_TYPE)) { +  value = both = or_pike_types(old->u.type, value, 0); +  }    SET_SVAL(val, T_TYPE, 0, type, value); -  } else { +  } else if (!old) {    SET_SVAL(val, T_INT, NUMBER_NUMBER, integer, 0); -  +  } else { +  val = *old;    }    mapping_insert(remap->markers[marker_set], &key, &val); -  +  free_type(both);   }   #define store_marker(REMAP, M, T, F) store_marker(REMAP, M, debug_malloc_pass(T), F)