pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4489:    case TWOT(T_MANY, PIKE_T_TRANSITIVE):    case TWOT(T_PROGRAM, PIKE_T_TRANSITIVE):    tmp = expand_transitive(b, NULL, 0);    ret = low_type_binop(op, a, tmp, remap, aflags, bflags, remap_flags);    free_type(tmp);    return ret;       case TWOT(T_FUNCTION, PIKE_T_OPERATOR):    case TWOT(PIKE_T_OPERATOR, T_FUNCTION):    type_stack_mark(); -  push_finished_type(a); +     push_finished_type(b); -  switch(op) { -  case PT_BINOP_AND: -  push_reverse_type(T_AND); -  break; -  case PT_BINOP_OR: -  push_reverse_type(T_OR); -  break; -  case PT_BINOP_MINUS: -  push_type(T_NOT); -  push_reverse_type(T_AND); -  break; -  default: -  Pike_fatal("Unsupported.\n"); -  } +  push_finished_type(a); +  push_binop(op);    return pop_unfinished_type();       case TWOT(T_FUNCTION, T_FUNCTION):    case TWOT(T_FUNCTION, T_MANY):    case TWOT(T_MANY, T_FUNCTION):    case TWOT(T_MANY, T_MANY):    /* NB: For simplicity in the (common case)    * many(assign(m, mixed), m),    * we expand the many node (as required) to    * function(assign(m, mixed), many(assign(m, mixed), m)),
pike.git/src/pike_types.cmod:4662:    }    if ((bi->type != T_FUNCTION) && (bi->type != T_MANY)) {    if (bret) {    Pike_fatal("Unsupported type operation.\n");    }    break;    }    }       nargs = pop_stack_mark(); -  if (op & PT_BINOP_NOT_B) { +  if (op != PT_BINOP_AND) {    nargs = 0;    ai = a;    bi = b;    }       /* Either of a and/or b is a complex type. */ -  push_remap_markers(ai, NULL, remap, remap_flags); +     push_remap_markers(bi, NULL, remap,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); -  +  push_remap_markers(ai, NULL, remap, remap_flags);    -  switch(op) { -  case PT_BINOP_AND: -  push_reverse_type(T_AND); -  break; -  case PT_BINOP_OR: -  push_reverse_type(T_OR); -  break; -  case PT_BINOP_MINUS: -  push_type(T_NOT); -  push_reverse_type(T_AND); -  break; -  default: -  Pike_fatal("Unsupported.\n"); -  } +  push_binop(op);       while (nargs--) {    push_reverse_type(T_FUNCTION);    }    return pop_unfinished_type();       function_fail:    compiler_discard_type();    pop_stack_mark();    return NULL;
pike.git/src/pike_types.cmod:4867:    case '5': case '6': case '7': case '8': case '9':    {    int marker = remap_marker(remap, a->type, remap_flags);    if (!marker) return NULL;       tmp = remap_markers(b, NULL, remap,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);    if (!tmp) return NULL;    type_stack_mark();    push_finished_type(tmp); -  if (op == PT_BINOP_MINUS) { -  push_type(T_NOT); -  } +     push_type(marker); -  push_reverse_type(T_AND); +  push_binop(op);    free_type(tmp);    return pop_unfinished_type();    }    }    switch(b->type) {    case '0': case '1': case '2': case '3': case '4':    case '5': case '6': case '7': case '8': case '9':    {    int marker = remap_marker(remap, b->type,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);    if (!marker) return NULL;       tmp = remap_markers(a, NULL, remap, remap_flags);    if (!tmp) return NULL;    type_stack_mark(); -  push_finished_type(tmp); +     push_type(marker); -  if (op == PT_BINOP_MINUS) { -  push_type(T_NOT); -  } -  push_reverse_type(T_AND); +  push_finished_type(tmp); +  push_binop(op);    free_type(tmp);    return pop_unfinished_type();    }    }       if (a->type != b->type) {    if (((a->type & PIKE_T_MASK) == PIKE_T_OPERATOR) ||    ((b->type & PIKE_T_MASK) == PIKE_T_OPERATOR)) {    type_stack_mark(); -  push_remap_markers(a, NULL, remap, remap_flags); +     push_remap_markers(b, NULL, remap,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); -  if (op == PT_BINOP_MINUS) { -  push_type(T_NOT); -  } -  push_reverse_type(T_AND); +  push_remap_markers(a, NULL, remap, remap_flags); +  push_binop(op);    return pop_unfinished_type();    }    return NULL;    }       switch(a->type) {    case T_VOID:    case T_ZERO:    case T_FLOAT:    /* Not reached. Should be handled by the a == b test at