pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4552:    * be to allocate a new marker for each step of the expansion    * and to have explicit or nodes:    * function(assign(m1, mixed), many(assign(m2, mixed), or(m1, m2))).    */    {    int nargs;    struct pike_type *ai = a;    struct pike_type *bi = b;       type_stack_mark(); -  type_stack_mark(); /* To keep track of the number of args. */ +        while(1) {    /* Invariant:    * ai->type and bi->type are either T_FUNCTION or T_MANY.    */    enum pt_cmp_flags avoidable = 0;    enum pt_cmp_flags bvoidable = 0;       /* Check the argument. */   
pike.git/src/pike_types.cmod:4632:    tmp = low_type_binop(op, aret, bret, remap,    0, 0, remap_flags);       if (remap_flags & PT_FLAG_REMAP_TRACE) {    fprintf(stderr, "ret_tmp: ");    simple_describe_type(tmp);    fprintf(stderr, "\n");    }    if (!tmp) goto function_fail;    -  nargs = pop_stack_mark(); +  nargs = peek_stack_mark();       push_finished_type(tmp);    free_type(tmp);       nargs--;    push_reverse_type(T_MANY);       while (nargs--) {    push_reverse_type(T_FUNCTION);    }
pike.git/src/pike_types.cmod:4692:    * T_MANY(A, X) - T_MANY(~A, Y) == T_MANY(A, X - Y)    *    * T_MANY(A, X) - T_MANY(B, Y) ==    * T_OR(T_MANY(A, X - Y),    * T_AND(T_MANY(A, X),    * T_NOT(T_MANY(T_NOT(A - B), T_MIXED))))    */    if (avoidable && bvoidable) {    /* FIXME: What if tmp only differs due to remapping? */    if (tmp != a->car) { -  pop_stack_mark(); +     if (!tmp) {    push_remap_markers(a->cdr, NULL, remap, remap_flags);    push_type(T_VOID);    push_type(T_MANY);    return pop_unfinished_type();    }    /* FIXME: What about tmp->type == T_VOID? */    push_type(T_MIXED);    push_finished_type(tmp);    push_type(T_NOT);
pike.git/src/pike_types.cmod:4740:    0, remap_flags);       if (remap_flags & PT_FLAG_REMAP_TRACE) {    fprintf(stderr, "ret tmp: ");    simple_describe_type(tmp);    fprintf(stderr, "\n");    }       if (!tmp) goto function_fail;    -  pop_stack_mark(); +     push_finished_type(tmp);    push_remap_markers(a->car, NULL, remap, remap_flags);    push_type(T_MANY);       return pop_unfinished_type();    }    if (tmp) {    if (tmp->type != T_VOID) {    push_remap_markers(ai, NULL, remap, remap_flags);    push_finished_type(tmp);
pike.git/src/pike_types.cmod:4775:    }    free_type(tmp);    }    tmp = low_type_binop(op, ai, bi, remap, aflags, bflags, remap_flags);    if (tmp) {    push_finished_type(tmp);    push_remap_markers(a->car, NULL, remap, remap_flags);    push_type(T_FUNCTION);    free_type(tmp);    } -  nargs = pop_stack_mark(); +  nargs = peek_stack_mark();    if (!nargs) {    pop_stack_mark();    return NULL;    }    while (nargs-- > 1) push_type(T_OR);    return pop_unfinished_type();       default:    Pike_fatal("Unsupported.\n");    }       if (avoidable && bvoidable) break;    }       complex_function:    -  nargs = pop_stack_mark(); +  nargs = peek_stack_mark();    if (op != PT_BINOP_AND) {    nargs = 0;    ai = a;    bi = b;    }       /* Either of a and/or b is a complex type. */    push_remap_markers(bi, NULL, remap,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);    push_remap_markers(ai, NULL, remap, remap_flags);