pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4184:    struct remap_state *remap,    enum pt_cmp_flags aflags,    enum pt_cmp_flags bflags,    enum pt_remap_flags remap_flags)   {    struct pike_type *tmp, *tmp2, *ret;    struct pike_type *aret = NULL, *bret = NULL;    enum pt_cmp_flags avoidable;    enum pt_cmp_flags bvoidable;    +  recur:    if (remap_flags & PT_FLAG_REMAP_TRACE) {    fprintf(stderr, "low_type_binop(0x%04x, ", op);    simple_describe_type(a);    fprintf(stderr, ", ");    simple_describe_type(b);    fprintf(stderr, ", %p, 0x%04x, 0x%04x, 0x%02x)\n",    remap, aflags, bflags, remap_flags);    }       switch(op) {
pike.git/src/pike_types.cmod:4855:    ret = low_type_binop(op, a, tmp, remap, aflags, bflags, remap_flags);    free_type(tmp);    return ret;      #if 0    /* FIXME: */    case PIKE_T_RING:   #endif    }    -  if (a->type == T_VOID) { -  if (bvoidable) { -  if (op & PT_BINOP_AND) { -  add_ref(a); -  return a; -  } else { -  return NULL; -  } -  } -  if (op == PT_BINOP_MINUS) { -  add_ref(a); -  return a; -  } -  return NULL; -  } -  if (b->type == T_VOID) { -  if (op == PT_BINOP_MINUS) { -  add_ref(a); -  return a; -  } -  if (avoidable) { -  add_ref(b); -  return b; -  } -  return NULL; -  } -  -  if (b->type == T_MIXED) { -  /* NB: a being void has been handled above. */ -  if (op == PT_BINOP_MINUS) return NULL; -  return remap_markers(a, NULL, remap, remap_flags); -  } -  if (a->type == T_MIXED) { -  type_stack_mark(); -  push_remap_markers(b, NULL, remap, -  remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); -  if (op == PT_BINOP_MINUS) { -  push_type(T_NOT); -  } -  return pop_unfinished_type(); -  } -  +     switch(a->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, 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;
pike.git/src/pike_types.cmod:4935:    type_stack_mark();    push_type(marker);    push_finished_type(tmp);    push_binop(op);    free_type(tmp);    return pop_unfinished_type();    }    }       if (a->type != b->type) { +  if ((a->type == T_VOID) && bvoidable) { +  b = a; +  goto recur; +  } +  if ((b->type == T_VOID) && avoidable) { +  a = b; +  goto recur; +  } +  +  if (b->type == T_MIXED) { +  /* NB: a being void has been handled above. */ +  if (op == PT_BINOP_MINUS) return NULL; +  return remap_markers(a, NULL, remap, remap_flags); +  } +  if (a->type == T_MIXED) { +  type_stack_mark(); +  push_remap_markers(b, NULL, remap, +  remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); +  if (op == PT_BINOP_MINUS) { +  push_type(T_NOT); +  } +  return pop_unfinished_type(); +  } +     if (((a->type & PIKE_T_MASK) == PIKE_T_OPERATOR) ||    ((b->type & PIKE_T_MASK) == PIKE_T_OPERATOR)) {    type_stack_mark();    push_remap_markers(b, NULL, remap,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);    push_remap_markers(a, NULL, remap, remap_flags);    push_binop(op);    return pop_unfinished_type();    }    /* NB: We know that a and b do not intersect, so the operations