From f3ed417250fcc68bb1bad215642d969d85532f70 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 16 Nov 2008 07:21:05 +0000 Subject: [PATCH] Fix get_reference_address(), which was broken in r23351. [r23695] --- parser.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/parser.c b/parser.c index 852f73a..72f91ef 100644 --- a/parser.c +++ b/parser.c @@ -8112,14 +8112,17 @@ static expression_t const *get_reference_address(expression_t const *expr) expr = expr->unary.value; } + if (expr->kind != EXPR_REFERENCE) + return NULL; + /* special case for functions which are automatically converted to a * pointer to function without an extra TAKE_ADDRESS operation */ - if (!regular_take_address && expr->kind == EXPR_REFERENCE - && expr->reference.entity->kind == ENTITY_FUNCTION) { - return expr; + if (!regular_take_address && + expr->reference.entity->kind != ENTITY_FUNCTION) { + return NULL; } - return NULL; + return expr; } static void warn_function_address_as_bool(expression_t const* expr) -- 2.20.1