From f3e5e1221c7cb4595e80121913d1e9ec6212de09 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 20 Dec 2007 16:16:37 +0000 Subject: [PATCH] Add missing skip_typeref() when printing constants. [r18815] --- ast.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ast.c b/ast.c index b13b7f4..4bf3258 100644 --- a/ast.c +++ b/ast.c @@ -177,10 +177,14 @@ static void print_const(const const_expression_t *cnst) if(cnst->base.type == NULL) return; - if(is_type_integer(cnst->base.type)) { + const type_t *const type = skip_typeref(cnst->base.type); + + if (is_type_integer(type)) { fprintf(out, "%lld", cnst->v.int_value); - } else if(is_type_float(cnst->base.type)) { + } else if (is_type_float(type)) { fprintf(out, "%Lf", cnst->v.float_value); + } else { + panic("unknown constant"); } } -- 2.20.1