resolve the case value before checking its type

This commit is contained in:
Bill Currie 2002-01-21 19:18:41 +00:00
parent 20eec42a93
commit f2d097c013
2 changed files with 4 additions and 0 deletions

View file

@ -131,6 +131,7 @@ expr_t *new_bind_expr (expr_t *e1, expr_t *e2);
expr_t *new_name_expr (const char *name);
void inc_users (expr_t *e);
void convert_name (expr_t *e);
expr_t *append_expr (expr_t *block, expr_t *e);

View file

@ -77,7 +77,10 @@ case_label_expr (switch_block_t *switch_block, expr_t *value)
if (!cl)
Sys_Error ("case_label_expr: Memory Allocation Failure\n");
if (value)
convert_name (value);
if (value && value->type < ex_string) {
print_expr (value);puts("");
error (value, "non-constant case value");
free (cl);
return 0;