pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:642:    if ((type == T_OR) && (car->type == T_OR)) {    Pike_fatal("Invalid CAR to OR node.\n");    }   #endif       debug_malloc_pass(t = alloc_pike_type());       t->refs = 0;    add_ref(t); /* For DMALLOC... */    t->type = type; -  t->flags = 0; +  t->flags = flag_method & ~PT_FLAG_MARK_ASSIGN;    t->car = car;    t->cdr = cdr;       t->hash = hash;    t->next = pike_type_hash[index];    pike_type_hash[index] = t;       if (flag_method) {    if (flag_method == PT_IS_MARKER) {    t->flags = PT_FLAG_MARKER_0 << (type-'0');    } else if (type == PIKE_T_SCOPE) {    /* The scope blocks propagation of markers. */    t->flags = cdr->flags & ~(PT_FLAG_MARKER|PT_FLAG_ASSIGN); -  +  } else if (type == T_OR) { +  if (car) { +  t->flags |= car->flags; +  } +  if (cdr) { +  t->flags |= cdr->flags; +  }    } else {    if (car && (flag_method & PT_COPY_CAR)) { -  t->flags |= car->flags; +  t->flags |= car->flags & PT_FLAG_MARK_ASSIGN;    }    if (cdr && (flag_method & PT_COPY_CDR)) { -  t->flags |= cdr->flags; +  t->flags |= cdr->flags & PT_FLAG_MARK_ASSIGN;;    }    }    }      #ifdef DEBUG_MALLOC    switch(type & PIKE_T_MASK) {    case T_FUNCTION:    case T_MANY:    case T_TUPLE:    case T_MAPPING:
pike.git/src/pike_types.cmod:1172:    case T_ASSIGN:    case T_INT:    case T_OBJECT:    case PIKE_T_ATTRIBUTE:    case PIKE_T_NAME:    default:    /* Should not occur. */    Pike_fatal("Unsupported argument to push_type(): %d\n", type);    break;    -  case T_FLOAT: -  case T_MIXED: +     case T_VOID: -  +  /* Leaf type. */ +  *(++Pike_compiler->type_stackp) = mk_type(type, NULL, NULL, +  PT_FLAG_VOIDABLE); +  break; +  case T_MIXED:    case T_ZERO: -  +  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];    push_type_operator(type, t);
pike.git/src/pike_types.cmod:12182:       /* FALLTHRU */    case PIKE_T_MIXED:    copy_pike_type(res, mixed_type_string);    break;       case PIKE_T_FUNCTION:    do {    if (!match_types(fun_type->car, void_type_string)) {    /* Too few arguments. */ + #ifdef PIKE_DEBUG +  if (fun_type->car && (fun_type->car->flags & PT_FLAG_VOIDABLE)) { +  fprintf(stderr, "voidable mismatch for "); +  simple_describe_type(fun_type->car); +  fprintf(stderr, " flags: 0x%08x\n", fun_type->car->flags); +  } + #endif    break;    } -  + #ifdef PIKE_DEBUG +  if (fun_type->car && !(fun_type->car->flags & PT_FLAG_VOIDABLE)) { +  fprintf(stderr, "voidable mismatch for "); +  simple_describe_type(fun_type->car); +  fprintf(stderr, " flags: 0x%08x\n", fun_type->car->flags); +  } + #endif    fun_type = fun_type->cdr;    } while(fun_type->type == PIKE_T_FUNCTION);    if (fun_type->type != T_MANY) {    /* Still too few arguments. */    break;    }    /* FALLTHRU */    case T_MANY:    copy_pike_type(res, fun_type->cdr);    break;