pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4732:       /* First check for markers. */    switch(a?a->type:PIKE_T_UNKNOWN) {    case T_ASSIGN:    {    int marker;    tmp = low_type_binop(PT_BINOP_AND, a->cdr, b, remap,    aflags, bflags, remap_flags);       marker = alloc_remap_marker(remap, CAR_TO_INT(a), remap_flags); +  /* Marker value */    store_marker(remap, marker, tmp);       if (op != PT_BINOP_AND) {    if ((op == PT_BINOP_MINUS) && !tmp) {    tmp = a->cdr;    if (tmp) add_ref(tmp);    } else if ((op == PT_BINOP_MINUS) && (tmp == a->cdr)) {    free_type(tmp);    tmp = NULL;    } else {    free_type(tmp);    tmp = low_type_binop(op, a->cdr, b, remap,    aflags, bflags, remap_flags);    }    }    -  +  /* Value to backpatch. */    store_marker(remap, marker | 0x100, tmp);       if (!tmp) return NULL;       type_stack_mark();    push_finished_type(tmp);    push_assign_type(marker);    free_type(tmp);    return pop_unfinished_type();    }    }    switch(b?b->type:PIKE_T_UNKNOWN) {    case T_ASSIGN:    {    int marker;    tmp = low_type_binop(PT_BINOP_AND, a, b->cdr, remap,    aflags, bflags, remap_flags);       marker = alloc_remap_marker(remap, CAR_TO_INT(b),    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); -  +  /* Marker value */    store_marker(remap, marker, tmp);       if (op != PT_BINOP_AND) {    if ((op == PT_BINOP_MINUS) && !tmp) {    tmp = a;    if (tmp) add_ref(tmp);    } else if ((op == PT_BINOP_MINUS) && (tmp == a)) {    free_type(tmp);    tmp = NULL;    } else {    free_type(tmp);    tmp = low_type_binop(op, a, b->cdr, remap,    aflags, bflags, remap_flags);    }    }    -  +  /* Value to backpatch. */    store_marker(remap, marker | 0x100, tmp);    -  if (!tmp) return NULL; -  +  /* NB: We can only keep the marker assignment in the PT_BINOP_AND +  * case. +  * +  * See also the b->type == '0'..'9' case further below. +  */ +  if ((op == PT_BINOP_AND) && tmp) {    type_stack_mark();    push_finished_type(tmp);    push_assign_type(marker);    free_type(tmp); -  return pop_unfinished_type(); +  tmp = pop_unfinished_type();    } -  +  +  return tmp;    } -  +  }       /* Attributes and names. */    switch(a?a->type:PIKE_T_UNKNOWN) {    case PIKE_T_NAME:    tmp = low_type_binop(op, a->cdr, b, remap, aflags, bflags, remap_flags);    if (!tmp) return NULL;    if (tmp != a->cdr) return tmp;    type_stack_mark();    push_finished_type(tmp);    push_type_name((struct pike_string *)(a->car));
pike.git/src/pike_types.cmod:5203:    b = lookup_marker(remap, marker);       if (!b) break;       tmp = low_type_binop(op, a, b, remap, aflags, bflags, remap_flags);       free_type(b);       /* FIXME: Do we need to invert for PT_BINOP_MINUS here? */    store_marker(remap, marker, tmp); -  if (op == PT_BINOP_AND) { +  +  /* NB: We can only keep the marker in the PT_BINOP_AND case, +  * as in the other cases we do not have the corresponding +  * assignment in the result. +  * +  * See also the b->type == T_ASSIGN case further above. +  */ +  if ((op == PT_BINOP_AND) && tmp) {    store_marker(remap, marker | 0x100, tmp); -  } +     -  if (!tmp) return NULL; +     free_type(tmp); -  +     type_stack_mark();    push_type(marker);    return pop_unfinished_type();    } -  +  +  return tmp;    } -  +  }       /* Handle a or b being NULL. */    /* NB: We know that a != b due to an earlier test. */    if (!a) {    if (op & PT_BINOP_INVERSE_MINUS) {    if (!((b == void_type_string) && (aflags & PT_FLAG_CMP_VOIDABLE)) &&    !((b == zero_type_string) && (aflags & PT_FLAG_CMP_NULLABLE))) {    add_ref(b);    return b;    }