pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:1044:    /* fprintf(stderr, "push_type(%d)\n", type); */       switch(type & PIKE_T_MASK) {    case T_OR:    case T_AND:    /* Special case: Check if the two top elements are equal. */    if (Pike_compiler->type_stackp[-1] == Pike_compiler->type_stackp[0]) {    free_type(*(Pike_compiler->type_stackp--));    return;    } +  if (!Pike_compiler->type_stackp[0]) { +  Pike_compiler->type_stackp--; +  if ((type & PIKE_T_MASK) == T_AND) { +  free_type(Pike_compiler->type_stackp[0]); +  Pike_compiler->type_stackp[0] = NULL; +  } +  return; +  } +  if (!Pike_compiler->type_stackp[-1]) { +  if ((type & PIKE_T_MASK) == T_AND) { +  free_type(Pike_compiler->type_stackp[0]); +  } else { +  Pike_compiler->type_stackp[-1] = Pike_compiler->type_stackp[0]; +  } +  Pike_compiler->type_stackp--; +  return; +  }    if (Pike_compiler->type_stackp[0]->type == type) {    /* The top type is the same as our type.    * Split it and join the parts with the other type.    */    struct pike_type *top = *(Pike_compiler->type_stackp--);    push_finished_type(top->cdr);    push_type(type);    push_finished_type(top->car);    push_type(type);    free_type(top);
pike.git/src/pike_types.cmod:1109:    PT_COPY_CAR);    break;       case T_NOT:    /* Make a new type of the top type, and put it in car.    *    * Special case: Remove double inversions.    */    {    struct pike_type *t = *Pike_compiler->type_stackp; +  if (!t) { +  Pike_compiler->type_stackp--; +  push_type(T_MIXED); +  push_type(T_VOID); +  push_type(T_OR); +  break; +  }    if (t->type == T_NOT) {    *Pike_compiler->type_stackp = t->car;    add_ref(t->car);    free_type(t);    break;    }    *Pike_compiler->type_stackp = mk_type(type, t, NULL, PT_COPY_CAR);    }    break;