aboutsummaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 7b3a576..98f5ec9 100644
--- a/eval.c
+++ b/eval.c
@@ -110,10 +110,11 @@ eval(struct expr *expr)
t = expr->type;
switch (expr->kind) {
case EXPRIDENT:
- if (expr->u.ident.decl->kind != DECLCONST)
+ d = expr->u.ident.decl;
+ if (d->kind != DECLCONST)
break;
expr->kind = EXPRCONST;
- expr->u.constant.u = intconstvalue(expr->u.ident.decl->value);
+ expr->u.constant.u = d->u.enumconst;
break;
case EXPRCOMPOUND:
if (expr->u.compound.decl->u.obj.storage != SDSTATIC)