pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:3270:    struct pike_type *type_a, *type_b;    struct pike_type *old_type;       if (n->type && !(n->node_info & OPT_TYPE_NOT_FIXED))    return; /* assume it is correct */       old_type = n->type;    n->type = 0;    n->node_info &= ~OPT_TYPE_NOT_FIXED;    +  /* +  These two are needed if we want to extract types +  from nodes while building the tree. +  */ +  if( CAR(n) ) fix_type_field(CAR(n)); +  if( CDR(n) ) fix_type_field(CDR(n)); +     switch(n->token)    {    case F_SOFT_CAST:    if (CAR(n) && CAR(n)->type) {   #ifdef NEW_ARG_CHECK    struct pike_type *soft_type = NULL;    if (CDR(n) && (CDR(n)->token == F_CONSTANT) &&    (TYPEOF(CDR(n)->u.sval) == T_TYPE)) {    soft_type = CDR(n)->u.sval.u.type;    if ((n->type = soft_cast(soft_type, CAR(n)->type, 0))) {
pike.git/src/las.c:3320:    copy_pike_type(n->type, old_type);    break;       case F_LAND:    case F_LOR:    if (!CAR(n) || CAR(n)->type == void_type_string) {    yyerror("Conditional uses void expression.");    copy_pike_type(n->type, mixed_type_string);    break;    } +     if(!match_types(CAR(n)->type, mixed_type_string))    yyerror("Bad conditional expression.");       if (!CDR(n) || CDR(n)->type == void_type_string)    copy_pike_type(n->type, void_type_string);    else if(n->token == F_LAND || CAR(n)->type == CDR(n)->type)    {    copy_pike_type(n->type, CDR(n)->type);    }else{    n->type = or_pike_types(CAR(n)->type, CDR(n)->type, 0);