From 71b3d30aa1b936c0d847bc1b831d73092eede928 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 12 Oct 2018 14:50:55 +0900 Subject: [PATCH] Make the ice a little more informative. --- tools/qfcc/include/expr.h | 1 + tools/qfcc/source/dot_expr.c | 2 +- tools/qfcc/source/statements.c | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/include/expr.h b/tools/qfcc/include/expr.h index 73d3f2399..f52930730 100644 --- a/tools/qfcc/include/expr.h +++ b/tools/qfcc/include/expr.h @@ -211,6 +211,7 @@ typedef struct expr_s { } expr_t; extern struct type_s *ev_types[]; +extern const char *expr_names[]; /** Report a type mismatch error. diff --git a/tools/qfcc/source/dot_expr.c b/tools/qfcc/source/dot_expr.c index accd8485a..43578a1c8 100644 --- a/tools/qfcc/source/dot_expr.c +++ b/tools/qfcc/source/dot_expr.c @@ -52,7 +52,7 @@ #include "qc-parse.h" #include "strpool.h" -static const char *expr_names[] = +const char *expr_names[] = { "error", "state", diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index 7c0fb693f..f86ae8d47 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -1017,7 +1017,8 @@ statement_subexpr (sblock_t *sblock, expr_t *e, operand_t **op) if (e->type > ex_value) internal_error (e, "bad expression type"); if (!sfuncs[e->type]) - internal_error (e, "unexpected expression type"); + internal_error (e, "unexpected expression type; %s", + expr_names[e->type]); sblock = sfuncs[e->type] (sblock, e, op); return sblock;