harec

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

commit d6e9169830c31dc7fddd1fe21358e621cd62093b
parent de0f374da023d1aade805bb0198bf45f76eba71b
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Sun, 21 Mar 2021 17:47:08 -0400

gen: fix casts between tagged unions

Specifically, when the source is smaller than the destination.

Diffstat:
Msrc/gen.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gen.c b/src/gen.c @@ -1188,7 +1188,7 @@ gen_cast_to_tagged(struct gen_context *ctx, return; } else if (!subtype) { pushc(ctx->current, "to_tagged; no subtype"); - alloc_temp(ctx, &ptr, tagged, "to_tagged.from.%d"); + alloc_temp(ctx, &ptr, from, "to_tagged.from.%d"); qval_deref(&ptr); gen_expression(ctx, expr->cast.value, &ptr); gen_copy(ctx, out, &ptr);