pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:824:    if (((min>0 && max>0) || (min<0 && max<0)) && min > max)    Pike_fatal("push_int_type(): Bad integer range:"    " min:%"PRINTPIKEINT"d, max:%"PRINTPIKEINT"d.\n",    min, max);   #endif /* PIKE_DEBUG */       if (!min && !max) {    /* Special case... */    push_type(T_ZERO);    } else { +  unsigned int flag_method = 0; +  if ((min <= 0) && (max >= 0)) { +  flag_method = PT_FLAG_NULLABLE; +  }    *(++Pike_compiler->type_stackp) = mk_type(T_INT,    (void *)(ptrdiff_t)min, -  (void *)(ptrdiff_t)max, 0); +  (void *)(ptrdiff_t)max, +  flag_method);    }    TYPE_STACK_DEBUG("push_int_type");   }      /**    * Used with arrays and strings.    *    * On entry the type stack contains the value type.    *    * Generates an array or string type with no length limits.
pike.git/src/pike_types.cmod:1193:    default:    /* Should not occur. */    Pike_fatal("Unsupported argument to push_type(): %d\n", type);    break;       case T_VOID:    /* Leaf type. */    *(++Pike_compiler->type_stackp) = mk_type(type, NULL, NULL,    PT_FLAG_VOIDABLE);    break; -  case T_MIXED: +     case T_ZERO: -  +  /* Leaf type. */ +  *(++Pike_compiler->type_stackp) = mk_type(type, NULL, NULL, +  PT_FLAG_NULLABLE); +  break; +  case T_MIXED: +  /* Leaf type. */ +  *(++Pike_compiler->type_stackp) = mk_type(type, NULL, NULL, +  PT_FLAG_MIXED|PT_FLAG_NULLABLE); +  break;    case T_FLOAT:    case PIKE_T_UNKNOWN:    /* Leaf type. */    *(++Pike_compiler->type_stackp) = mk_type(type, NULL, NULL, 0);    break;       case PIKE_T_OPERATOR:    if (type & 0x8000) {    struct pike_type *t = *(--Pike_compiler->type_stackp);    *Pike_compiler->type_stackp = Pike_compiler->type_stackp[1];
pike.git/src/pike_types.cmod:3466:    fprintf(stderr, " low_or_pike_types(");    simple_describe_type(t1);    fprintf(stderr, ", ");    simple_describe_type(t2);    fprintf(stderr, ")\n");   #endif    if(!t1)    {    push_finished_type(t2);    } -  else if((!t2) || (t2->type == T_ZERO && zero_implied)) -  { +  else if((!t2) || +  ((t2->type == T_ZERO) && +  (zero_implied || (t1->flags & PT_FLAG_NULLABLE)))) {    push_finished_type(t1);    } -  else if (t1->type == T_ZERO && zero_implied) -  { +  else if ((t1->type == T_ZERO) && +  (zero_implied || (t2->flags & PT_FLAG_NULLABLE))) {    push_finished_type(t2);    }    else if (t1 == t2) {    push_finished_type(t1);    } -  +  else if ((t1->flags & (PT_FLAG_MIXED|PT_FLAG_VOIDABLE)) == +  (PT_FLAG_MIXED|PT_FLAG_VOIDABLE)) { +  push_finished_type(t1); +  } +  else if ((t2->flags & (PT_FLAG_MIXED|PT_FLAG_VOIDABLE)) == +  (PT_FLAG_MIXED|PT_FLAG_VOIDABLE)) { +  push_finished_type(t2); +  }    else if ((t1->type == T_MIXED) && (t2->type != T_VOID)) {    push_finished_type(t1);    if (t2->flags & PT_FLAG_VOIDABLE) {    push_type(T_VOID);    push_type(T_OR);    }    } else if ((t2->type == T_MIXED) && (t1->type != T_VOID)) {    push_finished_type(t2);    if (t1->flags & PT_FLAG_VOIDABLE) {    push_type(T_VOID);