pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:51:    * Relevant for markers.    */   #ifdef TYPE_GROUPING   #define LE_A_GROUPED 4 /* Argument A has been grouped.    * Perform weaker checking for OR-nodes. */   #define LE_B_GROUPED 8 /* Argument B has been grouped.    * Perform weaker checking for OR-nodes. */   #define LE_A_B_GROUPED 12 /* Both the above two flags. */   #endif   #define LE_USE_HANDLERS 16 /* Call handlers if appropriate. */ + #define LE_EXPLICIT_ZERO 32 /* Zero is not subtype of all others. */      /*    * Flags used by low_get_first_arg_type()    *    * Note that these differ for the flags to get_first_arg_type().    */   #define FILTER_KEEP_VOID 1 /* Keep void during the filtering. */      /*    * Flags used as flag_method to mk_type()
pike.git/src/pike_types.c:4279:    if (array_cnt >= 0) {    /* !array(mixed) */    return 0;    }    }       if (a->type == T_ZERO) {    /* void <= zero <= any_type */    if (array_cnt >= 0) {    /* !array(zero) */ +  if (!(flags & LE_EXPLICIT_ZERO) || +  ((b->type == T_INT) && !array_cnt)) {    return 1;    }    } -  +  }       if (b->type == T_ZERO) {    if (array_cnt <= 0) {    /* !array(zero) */    return 0;    }    }       /* Special cases (tm) */    switch(TWOT(a->type, b->type))
pike.git/src/pike_types.c:6206:    case PIKE_T_MIXED:    copy_pike_type(res, mixed_type_string);    break;       case PIKE_T_FUNCTION:    case T_MANY:    /* Special case to detect workarounds for the old    * function call checker.    */    tmp = NULL; -  if ((fun_type->car->type == T_NOT) && +  if (((arg_type->type != T_NOT) || +  (arg_type->car->type != T_MIXED)) && +  (fun_type->car->type == T_NOT) &&    (fun_type->car->car->type == T_OR) &&    ((fun_type->car->car->car->type == T_MIXED) ||    (fun_type->car->car->cdr->type == T_MIXED))) {    /* Rebuild the function type without the negated mixed    * in the first argument.    */    type_stack_mark();    push_finished_type(fun_type->cdr);    if (fun_type->car->car->car->type == T_MIXED) {    push_finished_type(fun_type->car->car->cdr);
pike.git/src/pike_types.c:6242: Inside #if defined(PIKE_DEBUG)
   fprintf(stderr, ".\n");    }   #endif /* PIKE_DEBUG */    /* No need to perform advanced checking in the trivial case... */    if (arg_type != (tmp2 = fun_type->car)) {    if ((flags & CALL_7_6) && (arg_type == void_type_string)) {    /* Compat with Pike 7.6 and earlier. */    arg_type = zero_type_string;    }    -  if (!(/*(flags & CALL_INVERTED_TYPES)? -  low_pike_types_le(tmp2, arg_type, 0, LE_A_B_SWAPPED): */ +  if (!((flags & CALL_INVERTED_TYPES)? +  low_pike_types_le(tmp2, arg_type, 0, +  LE_A_B_SWAPPED|LE_EXPLICIT_ZERO):    low_pike_types_le(arg_type, tmp2, 0, 0)) &&    ((flags & CALL_STRICT) ||    !low_match_types(arg_type, tmp2, NO_SHORTCUTS))) {    /* No match. */   #ifdef PIKE_DEBUG    if (l_flag>2) {    fprintf(stderr, "%*sNo match.\n", indent*2+2, "");    }   #endif /* PIKE_DEBUG */    res = NULL;