pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:114:      void mapping_free_keypair(struct mapping_data *md, struct keypair *k)   {    FREE_KEYPAIR(md, k);   }      static INLINE int check_type_contains(TYPE_FIELD types, const struct svalue * s) {    return (TYPEOF(*s) == PIKE_T_OBJECT || types & (BIT_OBJECT|(1 << TYPEOF(*s))));   }    + static INLINE int check_type_overlaps(TYPE_FIELD t1, TYPE_FIELD t2) { +  return t1 & t2 || (t1|t2) & BIT_OBJECT; + } +    #ifdef PIKE_DEBUG      /** This function checks that the type field isn't lacking any bits.    * It is used for debugging purposes only.    */   static void check_mapping_type_fields(const struct mapping *m)   {    INT32 e;    const struct keypair *k=0;    const struct mapping_data *md;
pike.git/src/mapping.c:1873:    if (a->data == b->data) return 1;       /* If either is weak, they're different. */    if ((a->data->flags | b->data->flags) & MAPPING_WEAK) return 0;       check_mapping_for_destruct(a);    check_mapping_for_destruct(b);       if(m_sizeof(a) != m_sizeof(b)) return 0;    +  if (!check_type_overlaps(a->data->ind_types, b->data->ind_types) || +  !check_type_overlaps(a->data->val_types, b->data->val_types)) return 0; +     curr.pointer_a = a;    curr.pointer_b = b;    curr.next = p;       for( ;p ;p=p->next)    if(p->pointer_a == (void *)a && p->pointer_b == (void *)b)    return 1;       md=a->data;    md->valrefs++;