pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4520:    struct pike_type *ai = a;    struct pike_type *bi = b;    int got_empty = 0;    int got_full = 0;       type_stack_mark();    type_stack_mark(); /* To keep track of the number of args. */       while(1) {    /* Invariant: -  * a->type and b->type are either T_FUNCTION or T_MANY. +  * ai->type and bi->type are either T_FUNCTION or T_MANY.    */    enum pt_cmp_flags avoidable = 0;    enum pt_cmp_flags bvoidable = 0;       /* Check the argument. */       /* NB: The MANY argument is always voidable. */    if (ai->type == T_MANY) avoidable |= PT_FLAG_CMP_VOIDABLE;    if (bi->type == T_MANY) bvoidable |= PT_FLAG_CMP_VOIDABLE;   
pike.git/src/pike_types.cmod:4548:    if (!tmp) {    if (avoidable && bvoidable) {    /* NB: The VOIDABLE flag only affects comparisons with    * explicit void. If both arguments have implicit void,    * and nothing other in common, we arrive here.    */    push_type(T_VOID);    } else {    goto function_fail;    } -  } +  } else {    push_finished_type(tmp);    free_type(tmp); -  +  }       if (avoidable && bvoidable) {    /* Time to check the return types. */       if (!aret) aret = ai->cdr;    if (!bret) bret = bi->cdr;       tmp = low_type_binop(op, aret, bret, remap,    aflags, bflags, remap_flags);    if (!tmp) goto function_fail;
pike.git/src/pike_types.cmod:4585:    break;    case PT_BINOP_MINUS:    if (!tmp) {    if (got_full) goto function_next;    got_empty = 1;    } else {    if (tmp == ai) {    got_full = 1;    } else {    free_type(tmp); -  break; +  goto complex_function;    }    free_type(tmp);    if (got_empty) goto function_next;    }       if (avoidable && bvoidable) {    /* Time to check the return types. */       if (!aret) aret = ai->cdr;    if (!bret) bret = bi->cdr;
pike.git/src/pike_types.cmod:4625:    }       type_stack_mark();    push_remap_markers(a, NULL, remap, remap_flags);    return pop_unfinished_type();    }    break;    default:    Pike_fatal("Unsupported.\n");    } +     function_next:    -  +  if (avoidable && bvoidable) break; +     /* Advance to the next argument. */    if (ai->type == T_FUNCTION) {    ai = ai->cdr;    }    if (bi->type == T_FUNCTION) {    bi = bi->cdr;    }    if ((ai->type != T_FUNCTION) && (ai->type != T_MANY)) {    if (aret) {    Pike_fatal("Unsupported type operation.\n");
pike.git/src/pike_types.cmod:4648:    break;    }    if ((bi->type != T_FUNCTION) && (bi->type != T_MANY)) {    if (bret) {    Pike_fatal("Unsupported type operation.\n");    }    break;    }    }    +  complex_function: +     nargs = pop_stack_mark();    if (op != PT_BINOP_AND) {    nargs = 0;    ai = a;    bi = b;    }       /* Either of a and/or b is a complex type. */    push_remap_markers(bi, NULL, remap,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);
pike.git/src/pike_types.cmod:5118:    add_ref(b);    return b;    }    if ((a->car != b->car) || !is_compatible(ap, bp)) {    /* It is not possible to implement a class that    * implements both of the classes.    */    return NULL;    }    } +  break;    case PT_BINOP_MINUS:    if (!b->cdr) {    return NULL;    }    if (a->cdr) {    if (a->cdr == b->cdr) {    return NULL;    }    if (a->car && b->car) {    /* This is only possible if a->cdr == b->cdr, but that is