From da518d0c90db4edb51c1292446071ccf3e980549 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Wed, 27 Aug 2008 09:07:41 +0000 Subject: [PATCH] Set the result type of !, even if the operand type is not scalar. [r21496] --- parser.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/parser.c b/parser.c index c26ca18..b278121 100644 --- a/parser.c +++ b/parser.c @@ -6990,11 +6990,8 @@ static void semantic_not(unary_expression_t *expression) { type_t *const orig_type = expression->value->base.type; type_t *const type = skip_typeref(orig_type); - if (!is_type_scalar(type)) { - if (is_type_valid(type)) { - errorf(HERE, "operand of ! must be of scalar type"); - } - return; + if (!is_type_scalar(type) && is_type_valid(type)) { + errorf(HERE, "operand of ! must be of scalar type"); } expression->base.type = type_int; -- 2.20.1