pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:329:    prev = from->next;    from->next = next;    next = from;       if (md->flags & MAPPING_WEAK) {       switch(md->flags & MAPPING_WEAK) {    default:    Pike_fatal("Instable mapping data flags.\n");    case MAPPING_WEAK_INDICES: -  if ((TYPEOF(from->ind) <= MAX_REF_TYPE) && +  if (REFCOUNTED_TYPE(TYPEOF(from->ind)) &&    (*from->ind.u.refs > 1)) {    goto keep_keypair;    }    break;    case MAPPING_WEAK_VALUES: -  if ((TYPEOF(from->val) <= MAX_REF_TYPE) && +  if (REFCOUNTED_TYPE(TYPEOF(from->val)) &&    (*from->val.u.refs > 1)) {    goto keep_keypair;    }    break;    case MAPPING_WEAK:    /* NB: Compat: Unreference counted values are counted    * as multi-referenced here.    */ -  if (((TYPEOF(from->ind) > MAX_REF_TYPE) || +  if ((!REFCOUNTED_TYPE(TYPEOF(from->ind)) ||    (*from->ind.u.refs > 1)) && -  ((TYPEOF(from->val) > MAX_REF_TYPE) || +  (!REFCOUNTED_TYPE(TYPEOF(from->val)) ||    (*from->val.u.refs > 1))) {    goto keep_keypair;    }    break;    }       /* Free.    * Note that we don't need to free or unlink the keypair,    * since that will be done by the caller anyway. */    free_svalue(&from->ind);
pike.git/src/mapping.c:422:    prev = from->next;    from->next = next;    next = from;       if (md->flags & MAPPING_WEAK) {       switch(md->flags & MAPPING_WEAK) {    default:    Pike_fatal("Instable mapping data flags.\n");    case MAPPING_WEAK_INDICES: -  if ((TYPEOF(from->ind) <= MAX_REF_TYPE) && +  if (REFCOUNTED_TYPE(TYPEOF(from->ind)) &&    (*from->ind.u.refs > 1)) {    goto keep_keypair;    }    break;    case MAPPING_WEAK_VALUES: -  if ((TYPEOF(from->val) <= MAX_REF_TYPE) && +  if (REFCOUNTED_TYPE(TYPEOF(from->val)) &&    (*from->val.u.refs > 1)) {    goto keep_keypair;    }    break;    case MAPPING_WEAK:    /* NB: Compat: Unreference counted values are counted    * as multi-referenced here.    */ -  if (((TYPEOF(from->ind) > MAX_REF_TYPE) || +  if ((!REFCOUNTED_TYPE(TYPEOF(from->ind)) ||    (*from->ind.u.refs > 1)) && -  ((TYPEOF(from->val) > MAX_REF_TYPE) || +  (!REFCOUNTED_TYPE(TYPEOF(from->val)) ||    (*from->val.u.refs > 1))) {    goto keep_keypair;    }    break;    }       /* Skip copying of this keypair.    *    * NB: We can't mess with the original md here,    * since it might be in use by an iterator