harec

[hare] Hare compiler, written in C11 for POSIX OSs
Log | Files | Refs | README | LICENSE

commit 85793f307add8b31fdda881d5575f51b704c986d
parent 847cf9b70c80ed7df4cb062956b9ab12c9ebb88c
Author: Bor Grošelj Simić <bgs@turminal.net>
Date:   Tue,  7 Feb 2023 05:05:51 +0100

convert redundant check to assert

This is already tested for in resolve_type

Signed-off-by: Bor Grošelj Simić <bgs@turminal.net>

Diffstat:
Msrc/check.c | 7+------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/check.c b/src/check.c @@ -2698,12 +2698,7 @@ check_expr_struct(struct context *ctx, "Unknown type alias"); return; } - - if (obj->otype != O_TYPE) { - error(ctx, aexpr->loc, expr, - "Name does not refer to a type"); - return; - } + assert(obj->otype == O_TYPE); stype = obj->type; enum type_storage storage = type_dealias(stype)->storage; if (storage != STORAGE_STRUCT && storage != STORAGE_UNION) {