pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4579:    case PT_BINOP_XOR:    /* A XOR B == (A OR B) - (A AND B) */    tmp = low_type_binop(PT_BINOP_OR, a, b, remap,    aflags, bflags, remap_flags);    if (!tmp) return NULL;       tmp2 = low_type_binop(PT_BINOP_AND, a, b, remap,    aflags, bflags, remap_flags);    if (!tmp2) return tmp;    -  ret = low_type_binop(PT_BINOP_MINUS, tmp, tmp2, NULL, 0, 0, 0); +  ret = low_type_binop(PT_BINOP_MINUS, tmp, tmp2, NULL, 0, 0, +  remap_flags & PT_FLAG_REMAP_INEXACT);    free_type(tmp);    free_type(tmp2);    return ret;       case PT_BINOP_XNOR:    /* A XNOR B == (A NAND B) - (A NOR B) */    tmp = low_type_binop(PT_BINOP_NAND, a, b, remap,    aflags, bflags, remap_flags);    if (!tmp) return NULL;       tmp2 = low_type_binop(PT_BINOP_NOR, a, b, remap,    aflags, bflags, remap_flags);    if (!tmp2) return tmp;    -  ret = low_type_binop(PT_BINOP_MINUS, tmp, tmp2, NULL, 0, 0, 0); +  ret = low_type_binop(PT_BINOP_MINUS, tmp, tmp2, NULL, 0, 0, +  remap_flags & PT_FLAG_REMAP_INEXACT);    free_type(tmp);    free_type(tmp2);    return ret;       default:    /* Make the C-compiler happy. */   #ifdef PIKE_DEBUG    Pike_fatal("Unsupported binary type operation: 0x%02x\n", op);   #endif    break;
pike.git/src/pike_types.cmod:4728:    /* Do not propagate marker changes between the branches    * of the T_OR node.    *    * FIXME: It is theoretically possible to propagate marker    * changes up if they are compatible in both branches.    */    orig_markers = remap->markers;    remap->markers = copy_mapping(orig_markers);    }    tmp = low_type_binop(op, a->car, b, remap, aflags, bflags, remap_flags); +  if ((remap_flags & PT_FLAG_REMAP_INEXACT) && tmp) { +  if ((op == PT_BINOP_AND) || (op == PT_BINOP_MINUS)) { +  free_type(tmp); +  add_ref(a); +  return a; +  } +  }    if (remap) {    do_free_mapping(remap->markers);    remap->markers = copy_mapping(orig_markers);    }    tmp2 = low_type_binop(op, a->cdr, b, remap, aflags, bflags, remap_flags);    if (remap) {    do_free_mapping(remap->markers);    remap->markers = orig_markers;    }    }
pike.git/src/pike_types.cmod:4826:    * of the T_OR node.    *    * FIXME: It is theoretically possible to propagate marker    * changes up if they are compatible in both branches.    */    orig_markers = remap->markers;    remap->markers = copy_mapping(orig_markers);    }       tmp = low_type_binop(op, a, b->car, remap, aflags, bflags, remap_flags); +  if ((remap_flags & PT_FLAG_REMAP_INEXACT) && tmp) { +  if (op == PT_BINOP_AND) { +  free_type(tmp); +  add_ref(a); +  return a; +  } +  }    if (remap) {    do_free_mapping(remap->markers);    remap->markers = copy_mapping(orig_markers);    }    if ((op == PT_BINOP_MINUS) || (op == PT_BINOP_OR)) {    /* Special case to avoid excessively complicated expressions    * in the result.    *    * A - (B | C) == (A - B) - C    * rather than
pike.git/src/pike_types.cmod:9450:    struct remap_state remap;    struct pike_type *tmp, *tmp2 = NULL;   #ifdef PIKE_EXTRA_DEBUG    int res;    struct pike_type **save_type_stackp = Pike_compiler->type_stackp;    struct pike_type ***save_mark_stackp = Pike_compiler->pike_type_mark_stackp;   #endif       INIT_REMAP_STATE(remap);    -  tmp = low_type_binop(PT_BINOP_MINUS, a, b, &remap, aflags, bflags, 0); +  tmp = low_type_binop(PT_BINOP_MINUS, a, b, &remap, aflags, bflags, +  PT_FLAG_REMAP_INEXACT);       if (tmp) {    clear_mapping(remap.markers);       tmp2 = remap_markers(tmp, &remap, PT_FLAG_REMAP_EVAL_MARKERS);    }      #ifdef PIKE_EXTRA_DEBUG    clear_markers();    res = low_pike_types_le(a, b, 0, 0);