aboutsummaryrefslogtreecommitdiff
path: root/stmt.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-23 21:22:25 -0700
committerMichael Forney <mforney@mforney.org>2019-04-23 21:23:19 -0700
commita98385a607aafe373c14d2a6fb2778d21a600c30 (patch)
tree2b4c71cfb8f7ceab26e65f4489905a85488f6791 /stmt.c
parente0b772b836265b77686e9a7aa8ad01bb1fca53e7 (diff)
Fix integer promotion on bit-fields
Fixes #47.
Diffstat (limited to 'stmt.c')
-rw-r--r--stmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stmt.c b/stmt.c
index 4033a69..c53c969 100644
--- a/stmt.c
+++ b/stmt.c
@@ -127,7 +127,7 @@ stmt(struct func *f, struct scope *s)
if (!(e->type->prop & PROPINT))
error(&tok.loc, "controlling expression of switch statement must have integer type");
- e = exprconvert(e, typeintpromote(e->type));
+ e = exprpromote(e);
label[0] = mkblock("switch_cond");
label[1] = mkblock("switch_join");