From ee1f5dbb7164e2667364f68836051589df2bd96d Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Wed, 27 Aug 2008 14:24:52 +0000 Subject: [PATCH] Fix off-by-one error in source position of unary operations. [r21516] --- parser.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/parser.c b/parser.c index 1785a6f..9b87198 100644 --- a/parser.c +++ b/parser.c @@ -7086,11 +7086,10 @@ static void semantic_take_addr(unary_expression_t *expression) #define CREATE_UNARY_EXPRESSION_PARSER(token_type, unexpression_type, sfunc) \ static expression_t *parse_##unexpression_type(unsigned precedence) \ { \ - eat(token_type); \ - \ expression_t *unary_expression \ = allocate_expression_zero(unexpression_type); \ unary_expression->base.source_position = *HERE; \ + eat(token_type); \ unary_expression->unary.value = parse_sub_expression(precedence); \ \ sfunc(&unary_expression->unary); \ @@ -7121,11 +7120,11 @@ static expression_t *parse_##unexpression_type(unsigned precedence, \ expression_t *left) \ { \ (void) precedence; \ - eat(token_type); \ \ expression_t *unary_expression \ = allocate_expression_zero(unexpression_type); \ unary_expression->base.source_position = *HERE; \ + eat(token_type); \ unary_expression->unary.value = left; \ \ sfunc(&unary_expression->unary); \ -- 2.20.1