pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4089:    case T_OR:    case T_AND:    tmp = low_subtract_types(a->car, b, remap, aflags, bflags, remap_flags);    if (!tmp && (a->type == T_AND)) return NULL;    tmp2 = low_subtract_types(a->cdr, b, remap, aflags, bflags, remap_flags);    if (!tmp2) {    if (a->type == T_OR) return tmp;    free_type(tmp);    return NULL;    } -  if (a->type == T_AND) { -  ret = low_intersect_types(tmp, tmp2, NULL, aflags, bflags, remap_flags); -  } else { -  ret = or_pike_types(tmp, tmp2, 0); +  if (!tmp) { +  return tmp2;    } -  +  type_stack_mark(); +  push_finished_type(tmp); +  push_finished_type(tmp2); +  push_reverse_type(a->type);    free_type(tmp);    free_type(tmp2); -  return ret; +  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);
pike.git/src/pike_types.cmod:4741:    case T_OR:    case T_AND:    tmp = low_intersect_types(a->car, b, remap, aflags, bflags, remap_flags);    if (!tmp && (a->type == T_AND)) return NULL;    tmp2 = low_intersect_types(a->cdr, b, remap, aflags, bflags, remap_flags);    if (!tmp2) {    if (a->type == T_OR) return tmp;    free_type(tmp);    return NULL;    } -  if (a->type == T_AND) { -  ret = low_intersect_types(tmp, tmp2, NULL, aflags, bflags, remap_flags); -  } else { -  ret = or_pike_types(tmp, tmp2, 0); +  if (!tmp) { +  return tmp2;    } -  +  type_stack_mark(); +  push_finished_type(tmp); +  push_finished_type(tmp2); +  push_reverse_type(a->type);    free_type(tmp);    free_type(tmp2); -  return ret; +  return pop_unfinished_type();    }    switch(b->type) {    case T_OR:    case T_AND:    tmp = low_intersect_types(a, b->car, remap, aflags, bflags, remap_flags);    if (!tmp && (b->type == T_AND)) return NULL;    tmp2 = low_intersect_types(a, b->cdr, remap, aflags, bflags, remap_flags);    if (!tmp2) {    if (b->type == T_OR) return tmp;    free_type(tmp);    return NULL;    } -  if (b->type == T_AND) { -  ret = low_intersect_types(tmp, tmp2, NULL, aflags, bflags, remap_flags); -  } else { -  ret = or_pike_types(tmp, tmp2, 0); +  if (!tmp) { +  return tmp2;    } -  +  type_stack_mark(); +  push_finished_type(tmp); +  push_finished_type(tmp2); +  push_reverse_type(b->type);    free_type(tmp);    free_type(tmp2); -  return ret; +  return pop_unfinished_type();    }       /* NB: Complex types from this point onwards are containers,    * and the voidable property does not propagate into them.    */    avoidable = aflags & PT_FLAG_CMP_VOIDABLE;    aflags &= ~PT_FLAG_CMP_VOIDABLE;    bvoidable = bflags & PT_FLAG_CMP_VOIDABLE;    bflags &= ~PT_FLAG_CMP_VOIDABLE;