Branch: Tag:

2021-12-21

2021-12-21 10:28:38 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: Support __unknown__ in {lookup,store}_marker().

Also: lookup_marker() now adds a reference to the returned type.

3986:    val = low_mapping_lookup(remap->markers, &key);    if (!val) return NULL;    -  if (TYPEOF(*val) == PIKE_T_TYPE) { +  if ((TYPEOF(*val) == PIKE_T_TYPE) && val->u.type) { +  add_ref(val->u.type);    return val->u.type;    }    return NULL;
4005:    }       SET_SVAL(key, T_INT, NUMBER_NUMBER, integer, marker); +  if (value) {    SET_SVAL(val, T_TYPE, 0, type, value); -  +  } else { +  SET_SVAL(val, T_INT, NUMBER_NUMBER, integer, 0); +  }    mapping_insert(remap->markers, &key, &val);   }   #define store_marker(REMAP, M, T) store_marker(REMAP, M, debug_malloc_pass(T))
4042:    add_ref(new);    }    store_marker(remap, marker, new); -  free_pike_type(new); +  free_type(new);    } -  +  free_type(old);    push_remap_markers(t->cdr, remap, flags);    }   
4062:    add_ref(new);    }    store_marker(remap, marker, new); -  free_pike_type(new); +  free_type(new); +  free_type(old);    push_remap_markers(t->cdr, remap, flags);       switch(flags & PT_FLAG_REMAP_BOTH_MARKERS_MASK) {
4089:       if (value) {    push_remap_markers(value, remap, flags); +  free_type(value);    } else if (flags & PT_FLAG_REMAP_EVAL_MARKERS) {    /* Marker without matching assign. */    /* FIXME: Report error? */
4112:       if (value) {    push_remap_markers(value, remap, flags); +  free_type(value);    } else if (flags & PT_FLAG_REMAP_EVAL_MARKERS) {    /* Marker without matching assign. */    /* FIXME: Report error? */