From b8127f75438f7764e55c5e057c3412c256249c9a Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 7 Feb 2011 09:57:26 +0900 Subject: [PATCH] Do not segfault when printing a pointer value with a bogus type --- tools/qfcc/source/dot_expr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/dot_expr.c b/tools/qfcc/source/dot_expr.c index c8c6d822c..0de65bc49 100644 --- a/tools/qfcc/source/dot_expr.c +++ b/tools/qfcc/source/dot_expr.c @@ -279,6 +279,7 @@ static void print_value (expr_t *e, int level, int id) { int indent = level * 2 + 2; + type_t *type; const char *label = "?!?"; switch (e->e.value.type) { @@ -302,8 +303,9 @@ print_value (expr_t *e, int level, int id) e->e.value.v.quaternion_val[3]); break; case ev_pointer: + type = e->e.value.v.pointer.type; label = va ("(%s)[%d]", - pr_type_name[e->e.value.v.pointer.type->type], + type ? pr_type_name[type->type] : "???", e->e.value.v.pointer.val); break; case ev_field: