harec

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

commit 555483740347dd7aacf361cea148151545255732
parent 923386d12a84d40e162284def0f38b062fea97e7
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon, 24 May 2021 09:52:52 -0400

Add new fixed assertion for static insert/append

Diffstat:
Minclude/gen.h | 3++-
Msrc/gen.c | 4++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/gen.h b/include/gen.h @@ -10,7 +10,8 @@ enum fixed_aborts { ABORT_OOB = 0, ABORT_TYPE_ASSERTION = 1, - ABORT_ALLOC_FAILURE = 2 + ABORT_ALLOC_FAILURE = 2, + ABORT_STATIC_EXCEEDED = 3, }; struct unit; diff --git a/src/gen.c b/src/gen.c @@ -731,7 +731,7 @@ gen_expr_append(struct gen_context *ctx, pushi(ctx->current, NULL, Q_JNZ, &valid, &bvalid, &binvalid, NULL); push(&ctx->current->body, &invalidl); - gen_fixed_abort(ctx, expr->loc, ABORT_OOB); + gen_fixed_abort(ctx, expr->loc, ABORT_STATIC_EXCEEDED); push(&ctx->current->body, &validl); } @@ -2061,7 +2061,7 @@ gen_expr_insert(struct gen_context *ctx, pushi(ctx->current, NULL, Q_JNZ, &valid, &bvalid, &binvalid, NULL); push(&ctx->current->body, &invalidl); - gen_fixed_abort(ctx, expr->loc, ABORT_OOB); + gen_fixed_abort(ctx, expr->loc, ABORT_STATIC_EXCEEDED); push(&ctx->current->body, &validl); }