diff options
| author | 2025-10-16 17:53:42 +0200 | |
|---|---|---|
| committer | 2025-10-16 17:53:42 +0200 | |
| commit | d051c17c70c86b3c9bbc0a0761203d97e8c662d0 (patch) | |
| tree | 0a4b1e27b5a7ef3092a476952727def0900d496a /c.c | |
| parent | 77b13b42643991fc8c2b8942ca167eb7bf156908 (diff) | |
various little bugs
Diffstat (limited to 'c.c')
| -rw-r--r-- | c.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -3423,12 +3423,12 @@ genswitch(struct comp *cm, struct function *fn, const struct expr *ex) EMITS { struct block *next = i < st.cases.n - 1 ? newblk(fn) : st.bdefault; putcondbranch(fn, addinstr(fn, mkinstr(Oequ, k, .l = sel, .r = mkintcon(k, c.val))), c.blk, next); - useblk(fn, next); + if (next != st.bdefault) useblk(fn, next); } } vfree(&st.cases); if (fn->curblk != end) { - EMITS putbranch(fn, end); + if (fn->curblk) EMITS putbranch(fn, end); useblk(fn, end); } } @@ -3517,7 +3517,8 @@ stmt(struct comp *cm, struct function *fn) terminates = 0; } else { EMITS { - if (!terminates) putbranch(fn, end = newblk(fn)); + end = newblk(fn); + if (!terminates) putbranch(fn, end); useblk(fn, fl); } terminates &= stmt(cm, fn); |