aboutsummaryrefslogtreecommitdiff
path: root/stmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmt.c')
-rw-r--r--stmt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/stmt.c b/stmt.c
index 075feff..0a5c118 100644
--- a/stmt.c
+++ b/stmt.c
@@ -54,7 +54,7 @@ stmt(struct func *f, struct scope *s)
struct type *t;
struct value *v;
struct block *label[4];
- struct switchcases swtch = {0};
+ struct switchcases swtch;
uint64_t i;
while (gotolabel(f))
@@ -151,6 +151,10 @@ stmt(struct func *f, struct scope *s)
error(&tok.loc, "controlling expression of switch statement must have integer type");
e = exprpromote(e);
+ swtch.root = NULL;
+ swtch.type = e->type;
+ swtch.defaultlabel = NULL;
+
label[0] = mkblock("switch_cond");
label[1] = mkblock("switch_join");