pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4622:    remap_flags | PT_FLAG_REMAP_BOTH_MARKERS_AND);    } else {    return NULL;    }    }       /* First check for markers. */    switch(a?a->type:PIKE_T_UNKNOWN) {    case T_ASSIGN:    { -  int marker = alloc_remap_marker(remap, CAR_TO_INT(a), remap_flags); +  int marker;    tmp = low_type_binop(op, a->cdr, b, remap, aflags, bflags, remap_flags); -  if (tmp) { +  if (!tmp) return NULL; +  marker = alloc_remap_marker(remap, CAR_TO_INT(a), remap_flags); +  store_marker(remap, marker, tmp);    type_stack_mark();    push_finished_type(tmp);    push_assign_type(marker);    free_type(tmp);    return pop_unfinished_type();    } -  free_marker(remap, CAR_TO_INT(a), remap_flags); -  return NULL; +     } -  } +     switch(b?b->type:PIKE_T_UNKNOWN) {    case T_ASSIGN:    { -  int marker = alloc_remap_marker(remap, CAR_TO_INT(b), -  remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); +  int marker;    tmp = low_type_binop(op, a, b->cdr, remap, aflags, bflags, remap_flags); -  if (tmp) { +  if (!tmp) return NULL; +  marker = alloc_remap_marker(remap, CAR_TO_INT(b), +  remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); +  store_marker(remap, marker, tmp);    type_stack_mark();    push_finished_type(tmp);    push_assign_type(marker);    free_type(tmp);    return pop_unfinished_type();    } -  -  free_marker(remap, CAR_TO_INT(b), -  remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); -  return NULL; +     } -  } +        /* 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:4998:    /*    * NB: At this point a and b are either NULL, a basic type or a marker.    */       loop:    switch(a ? a->type : PIKE_T_UNKNOWN) {    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) {    a = NULL;    break;    }    -  tmp = remap_markers(b, remap, -  remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); +  a = lookup_marker(remap, marker); +  +  if (!a) break; +  +  tmp = low_type_binop(op, a, b, remap, aflags, bflags, remap_flags); +  +  free_type(a); +  +  store_marker(remap, marker, tmp); +     if (!tmp) { -  b = NULL; +  a = NULL;    break;    } -  +  free_type(tmp); +     type_stack_mark(); -  push_finished_type(tmp); +     push_type(marker); -  push_binop(op); -  free_type(tmp); +     return pop_unfinished_type();    }    }    switch(b ? b->type : PIKE_T_UNKNOWN) {    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) {    b = NULL;    break;    }    -  tmp = remap_markers(a, remap, remap_flags); +  b = lookup_marker(remap, marker); +  +  if (!b) break; +  +  tmp = low_type_binop(op, a, b, remap, aflags, bflags, remap_flags); +  +  free_type(b); +  +  store_marker(remap, marker, tmp); +     if (!tmp) { -  a = NULL; +  b = NULL;    break;    } -  +  free_type(tmp); +     type_stack_mark();    push_type(marker); -  push_finished_type(tmp); -  push_binop(op); -  free_type(tmp); +     return pop_unfinished_type();    }    }       /* 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))) {