harec

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

commit 33c9cbc5a7fc1e3b3c418847479f1c5aa6f05f65
parent 6ef434af84cd0e9d22951ea94e86c11698033294
Author: Bor Grošelj Simić <bgs@turminal.net>
Date:   Wed,  8 Feb 2023 05:13:26 +0100

gen: update comment about tagged casts

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

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

diff --git a/src/gen.c b/src/gen.c @@ -1360,9 +1360,9 @@ gen_expr_cast_tagged_at(struct gen_context *ctx, const struct type *subtype = tagged_select_subtype(to, from, true); if (!subtype && tagged_align_compat(from, to)) { - // Case 1: from is a union whose members are a subset of to, and - // the alignment matches, so we can just interpret values of - // type 'from' as if it were of type 'to' + // Case 1: from is a union whose members are a subset or + // superset of to, and the alignment matches, so we can just + // interpret values of type 'from' as if it were of type 'to' struct gen_value out2 = out; out2.type = from; gen_expr_at(ctx, expr->cast.value, out2);