aboutsummaryrefslogtreecommitdiff
path: root/stmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmt.c')
-rw-r--r--stmt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/stmt.c b/stmt.c
index 73e391c..f10bfb2 100644
--- a/stmt.c
+++ b/stmt.c
@@ -125,10 +125,9 @@ stmt(struct func *f, struct scope *s)
e = expr(s);
expect(TRPAREN, "after expression");
- t = typeunqual(e->type, NULL);
- if (!(typeprop(t) & PROPINT))
+ if (!(typeprop(e->type) & PROPINT))
error(&tok.loc, "controlling expression of switch statement must have integer type");
- e = exprconvert(e, typeintpromote(t));
+ e = exprconvert(e, typeintpromote(e->type));
label[0] = mkblock("switch_cond");
label[1] = mkblock("switch_join");