pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:5532:    if (bi->type == T_MANY) bvoidable |= PT_FLAG_CMP_VOIDABLE;      #if 0    fprintf(stderr, "arg_check(op: 0x%x, ", op);    simple_describe_type(ai);    fprintf(stderr, " (%d), ", avoidable);    simple_describe_type(bi);    fprintf(stderr, " (%d))\n\n", bvoidable);   #endif    -  /* FIXME: Use implicit nullable only for legacy types. */ +  /* FIXME: Use implicit nullable for legacy types? */    /* NOTE: Intentional use of PT_BINOP_OR below!    * Note that for function types a larger type for    * the arguments implies that the function type    * is stricter. This is a DeMorgan-style effect    * due to the implicit ALL and EXIST operators    * for arguments in function types. Eg there are    * many more functions that accept 0 as an argument    * than there are functions that accept any integer.    * Thus function(int:mixed) is a stricter type    * than function(zero:mixed).    */    tmp = low_type_binop(PT_BINOP_OR, ai->car, bi->car, remap, -  avoidable | PT_FLAG_CMP_NULLABLE, -  bvoidable | PT_FLAG_CMP_NULLABLE, -  remap_flags); +  avoidable, bvoidable, remap_flags);       /* 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.git/src/pike_types.cmod:5609:       push_finished_type(tmp);    free_type(tmp);       nargs--;    push_reverse_type(T_MANY);       while (nargs--) {    push_reverse_type(T_FUNCTION);    } +     return pop_unfinished_type();    }    }    break;       case PT_BINOP_MINUS:    /* Subtraction (A - B)    *    * T_FUNCTION(A, X) - T_FUNCTION(B, Y) ==    *
pike.git/src/pike_types.cmod:5655:    simple_describe_type(ai);    fprintf(stderr, " (%d), ", avoidable);    simple_describe_type(bi);    fprintf(stderr, " (%d))\n\n", bvoidable);   #endif       if (!bi->car) {    /* Common case */    tmp = NULL;    } else { -  /* FIXME: Use implicit nullable only for legacy types. +  /* FIXME: Use implicit nullable for legacy types?    * FIXME: What about PT_FLAG_CMP_VOID_IS_NULL?    */    tmp = low_type_binop(PT_BINOP_MINUS, bi->car, ai->car, remap, -  bvoidable | PT_FLAG_CMP_NULLABLE | PT_FLAG_CMP_INSEPARABLE, -  avoidable | PT_FLAG_CMP_NULLABLE | PT_FLAG_CMP_INSEPARABLE, +  bvoidable | PT_FLAG_CMP_INSEPARABLE, +  avoidable | PT_FLAG_CMP_INSEPARABLE,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);    if (tmp) {    /* No or not full overlap. */       if ((ai->car == void_type_string) &&    (aflags & PT_FLAG_CMP_IGNORE_EXTRA_ARGS)) {    /* End of argument list for a, and it is valid to end the    * argument list here (void matched), and a implicitly    * ignores any further arguments.    */
pike.git/src/pike_types.cmod:5684:    if (tmp == bi->car) {    /* Common case, no overlap. */    pop_stack_mark();    free_type(tmp);       return remap_markers(ai, remap, remap_flags);    }    free_type(tmp);       tmp = low_type_binop(PT_BINOP_MINUS, ai->car, bi->car, remap, -  avoidable | PT_FLAG_CMP_NULLABLE | PT_FLAG_CMP_INSEPARABLE, -  bvoidable | PT_FLAG_CMP_NULLABLE | PT_FLAG_CMP_INSEPARABLE, +  avoidable | PT_FLAG_CMP_INSEPARABLE, +  bvoidable | PT_FLAG_CMP_INSEPARABLE,    remap_flags);       if (tmp == ai->car) {    /* No overlap.    *    * The first overlap test likely failed due    * to remapping.    */    pop_stack_mark();    free_type(tmp);
pike.git/src/pike_types.cmod:5740:    if (!bret) bret = bi->cdr;       /* NB: Ignore the return type if matching against void. */    if (bret != void_type_string) {    tmp = low_type_binop(PT_BINOP_MINUS, aret, bret, remap,    PT_FLAG_CMP_VOIDABLE, 0, remap_flags);       if (tmp) {    /* Not full overlap for the return value. */    push_finished_type(tmp); -  push_finished_type(a->car); +  push_remap_markers(ai->car, remap, remap_flags);    push_type(T_MANY);    free_type(tmp);    } else {    push_type(PIKE_T_UNKNOWN);    }    } else {    push_type(PIKE_T_UNKNOWN);    }    } else {    /* Recurse. */    tmp = low_type_binop(PT_BINOP_MINUS, ai, bi, remap,    aflags, bflags, remap_flags);       if (tmp) {    push_finished_type(tmp); -  push_finished_type(a->car); +  push_remap_markers(a->car, remap, remap_flags);    push_type(PIKE_T_FUNCTION);    free_type(tmp);    } else {    push_type(PIKE_T_UNKNOWN);    }    }       while (peek_stack_mark() > 1) {    push_type(T_OR);    } -  +     return pop_unfinished_type();       default:    /* Fall back to complex_function below. */    break;    }       complex_function:    /* Either of ai and/or bi is a complex type. */