pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4116:    return pop_unfinished_type();    }    switch(b->type) {    case T_OR:    /* DeMorgan    *    * a & ~(b1 | b2) <==> a & ~b1 & ~b2    */    tmp = low_subtract_types(a, b->car, remap, aflags, bflags, remap_flags);    if (!tmp) return NULL; -  ret = low_intersect_types(tmp, b->cdr, remap, aflags, bflags, remap_flags); +  /* NB: We need to remap b->cdr separately to avoid remapping +  * markers in a and b->car twice. +  */ +  tmp2 = remap_markers(b->cdr, remap, +  remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); +  ret = low_subtract_types(tmp, tmp2, NULL, aflags, bflags, 0);    free_type(tmp); -  +  free_type(tmp2);    return ret;       case T_AND:    /* DeMorgan    *    * a & ~(b1 & b2) <==> a & (~b1 | ~b2) <==> (a & ~b1) | (a & ~b2)    */    tmp = low_subtract_types(a, b->car, remap, aflags, bflags, remap_flags); -  tmp2 = low_intersect_types(a, b->cdr, remap, aflags, bflags, remap_flags); +  tmp2 = low_subtract_types(a, b->cdr, remap, aflags, bflags, remap_flags);    if (!tmp2) return tmp;    ret = or_pike_types(tmp, tmp2, 0);    free_type(tmp);    free_type(tmp2);    return ret;    }       /* NB: Complex types from this point onwards are containers,    * and the voidable property does not propagate into them.    */
pike.git/src/pike_types.cmod:4257:    tmp = low_subtract_types(ai->car, bi->car, NULL,    aflags | avoidable, bflags | bvoidable,    remap_flags);    if (!tmp) {    if (got_full) break;    got_empty = 1;    } else {    if (tmp == ai) {    got_full = 1;    } else { +  free_type(tmp);    break;    }    free_type(tmp);    if (got_empty) break;    }       if (avoidable && bvoidable) {    /* Time to check the return types. */       if (!aret) aret = ai->cdr;
pike.git/src/pike_types.cmod:4278:       tmp = low_subtract_types(aret, bret, NULL, aflags, bflags,    remap_flags);    if (!tmp) {    if (got_full) break;    got_empty = 1;    } else {    if (tmp == aret) {    got_full = 1;    } else { +  free_type(tmp);    break;    }    free_type(tmp);    if (got_empty) break;    }       if (!got_full) {    return NULL;    }   
pike.git/src/pike_types.cmod:4415:    add_ref(a);    return a;    }       if (b->type == T_MIXED) {    /* NB: a being void has been handled above. */    return NULL;    }    if (a->type == T_MIXED) {    type_stack_mark(); -  push_type(T_MIXED); +     push_remap_markers(b, remap, remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);    push_type(T_NOT); -  push_reverse_type(T_AND); +     return pop_unfinished_type();    }       if (b->type == T_NOT) {    return low_intersect_types(a, b->car, remap, aflags, bflags, remap_flags);    }    if (a->type == T_NOT) {    /* DeMorgan and(not(a), not(b)) <==> not(or(a, b)) */    type_stack_mark(); -  push_remap_markers(a, remap, remap_flags); +  push_remap_markers(a->car, remap, remap_flags);    push_remap_markers(b, remap, remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);    push_type(T_OR);    push_type(T_NOT);    return pop_unfinished_type();    }       if (a->type != b->type) {    if (((a->type & PIKE_T_MASK) == PIKE_T_OPERATOR) ||    ((b->type & PIKE_T_MASK) == PIKE_T_OPERATOR)) {    type_stack_mark();