Make the ice a little more informative.

This commit is contained in:
Bill Currie 2018-10-12 14:50:55 +09:00
parent f58c2fef5a
commit 71b3d30aa1
3 changed files with 4 additions and 2 deletions

View File

@ -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.

View File

@ -52,7 +52,7 @@
#include "qc-parse.h"
#include "strpool.h"
static const char *expr_names[] =
const char *expr_names[] =
{
"error",
"state",

View File

@ -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;