harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ea119e788773884b379e2fb05af37280c16d6f68
parent 91f5e5fd6052a9d4cf090139ece04f627cda9d76
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Sat,  4 Sep 2021 02:52:44 +0000

gen: add unreachable abort to tagged match

Signed-off-by: Eyal Sawady <ecs@d2evs.net>

Diffstat:
Msrc/gen.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -2084,6 +2084,11 @@ next: if (_default) { bval = gen_expr_with(ctx, _default->value, out); branch_copyresult(ctx, bval, gvout, out); + } else { + struct qbe_statement labort; + mklabel(ctx, &labort, ".%d"); + push(&ctx->current->body, &labort); + gen_fixed_abort(ctx, expr->loc, ABORT_UNREACHABLE); } push(&ctx->current->body, &lout);