pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:5264:       /* Check implicit casting. */    switch(TWOT(a->type & PIKE_T_MASK, b->type & PIKE_T_MASK)) {    case TWOT(T_PROGRAM, T_TYPE):    case TWOT(T_PROGRAM, T_PROGRAM):    case TWOT(T_PROGRAM, T_FUNCTION):    case TWOT(T_PROGRAM, T_MANY):    case TWOT(T_PROGRAM, PIKE_T_TRANSITIVE):    aret = a->car;    a = low_object_lfun_type(aret, LFUN_CREATE); -  if (!a) { -  a = void_function_type_string; -  } -  goto loop; +  if (a) goto loop;    -  +  type_stack_mark(); +  push_finished_type(aret); +  push_type(PIKE_T_UNKNOWN); +  push_type(T_MANY); +  a = pop_unfinished_type(); +  +  ret = low_type_binop(op, a, b, remap, aflags, bflags, remap_flags); +  free_type(a); +  return ret; +     case TWOT(T_FUNCTION, T_PROGRAM):    case TWOT(T_MANY, T_PROGRAM):    case TWOT(PIKE_T_TRANSITIVE, T_PROGRAM):    bret = b->car;    b = low_object_lfun_type(bret, LFUN_CREATE); -  if (!b) { -  b = void_function_type_string; -  } -  goto loop; +  if (b) goto loop;    -  +  type_stack_mark(); +  push_finished_type(bret); +  push_type(PIKE_T_UNKNOWN); +  push_type(T_MANY); +  b = pop_unfinished_type(); +  +  ret = low_type_binop(op, a, b, remap, aflags, bflags, remap_flags); +  free_type(b); +  return ret; +     case TWOT(T_OBJECT, T_FUNCTION):    case TWOT(T_OBJECT, T_MANY):    case TWOT(T_OBJECT, T_PROGRAM):    case TWOT(T_OBJECT, PIKE_T_TRANSITIVE):    a = low_object_lfun_type(a, LFUN_CALL);    if (!a) return NULL;    goto loop;       case TWOT(T_FUNCTION, T_OBJECT):    case TWOT(T_MANY, T_OBJECT):
pike.git/src/pike_types.cmod:5310:    if (tmp || !a->car) {    free_type(tmp);    tmp = low_type_binop(op, a->cdr, b, NULL, aflags, bflags, remap_flags);    if (tmp) {    push_finished_type(tmp);    free_type(tmp);    push_reverse_type(PIKE_T_TRANSITIVE);    }    }    return pop_unfinished_type(); +  } else if (op == PT_BINOP_MINUS) { +  if ((!b->car || (b->car == zero_type_string)) && +  ((b->cdr == mixed_type_string) || (b->cdr == any_type_string))) { +  return NULL;    } -  +  }    /* FALLTHRU */    case TWOT(PIKE_T_TRANSITIVE, T_FUNCTION):    tmp = expand_transitive_remap(a, NULL, 0);    ret = low_type_binop(op, tmp, b, remap, aflags, bflags, remap_flags);    free_type(tmp);    return ret;       case TWOT(T_MANY, PIKE_T_TRANSITIVE):    if (op == PT_BINOP_AND) {    type_stack_mark();