diff --git a/src/las.c b/src/las.c index 59437e9fc47201d5f7e85e9c1ed79f11c6fe1864..d624469c8789482bfd78b58406ad4eb7ce04057b 100644 --- a/src/las.c +++ b/src/las.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: las.c,v 1.132 1999/11/25 00:56:23 hubbe Exp $"); +RCSID("$Id: las.c,v 1.133 1999/12/03 02:42:30 mast Exp $"); #include "language.h" #include "interpret.h" @@ -2100,19 +2100,17 @@ void fix_type_field(node *n) case F_LAND: case F_LOR: - if (!CAR(n) || CAR(n)->type == void_type_string || - !CDR(n) || CDR(n)->type == void_type_string) { - yyerror("Conditional contains void expression."); + if (!CAR(n) || CAR(n)->type == void_type_string) { + yyerror("Conditional uses void expression."); copy_shared_string(n->type, mixed_type_string); break; } if(!match_types(CAR(n)->type,mixed_type_string)) yyerror("Bad conditional expression."); - if(!match_types(CDR(n)->type,mixed_type_string)) - yyerror("Bad conditional expression."); - - if(CAR(n)->type == CDR(n)->type) + if (!CDR(n) || CDR(n)->type == void_type_string) + copy_shared_string(n->type,void_type_string); + else if(CAR(n)->type == CDR(n)->type) { copy_shared_string(n->type,CAR(n)->type); }else{ @@ -2283,7 +2281,9 @@ void fix_type_field(node *n) } else if(!match_types(CAR(n)->type,mixed_type_string)) yyerror("Bad conditional expression."); - if(!CDR(n) || !CADR(n) || !CDDR(n)) + if(!CDR(n) || !CADR(n) || !CDDR(n) || + CADR(n)->type == void_type_string || + CDDR(n)->type == void_type_string) { copy_shared_string(n->type,void_type_string); break;