pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:343:    goto keep_keypair;    }    break;    case MAPPING_WEAK_VALUES:    if ((TYPEOF(from->val) <= MAX_REF_TYPE) &&    (*from->val.u.refs > 1)) {    goto keep_keypair;    }    break;    case MAPPING_WEAK: -  if ((TYPEOF(from->ind) <= MAX_REF_TYPE) && -  (*from->ind.u.refs > 1) && -  (TYPEOF(from->val) <= MAX_REF_TYPE) && -  (*from->val.u.refs > 1)) { +  /* NB: Compat: Unreference counted values are counted +  * as multi-referenced here. +  */ +  if (((TYPEOF(from->ind) > MAX_REF_TYPE) || +  (*from->ind.u.refs > 1)) && +  ((TYPEOF(from->val) > MAX_REF_TYPE) || +  (*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);    free_svalue(&from->val);
pike.git/src/mapping.c:433:    goto keep_keypair;    }    break;    case MAPPING_WEAK_VALUES:    if ((TYPEOF(from->val) <= MAX_REF_TYPE) &&    (*from->val.u.refs > 1)) {    goto keep_keypair;    }    break;    case MAPPING_WEAK: -  if ((TYPEOF(from->ind) <= MAX_REF_TYPE) && -  (*from->ind.u.refs > 1) && -  (TYPEOF(from->val) <= MAX_REF_TYPE) && -  (*from->val.u.refs > 1)) { +  /* NB: Compat: Unreference counted values are counted +  * as multi-referenced here. +  */ +  if (((TYPEOF(from->ind) > MAX_REF_TYPE) || +  (*from->ind.u.refs > 1)) && +  ((TYPEOF(from->val) > MAX_REF_TYPE) || +  (*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    * or similar.