commit e6104847bf0a3d8caca20c7d189e14b5131ebdef
parent 5b50359c8ecf565c73a040445d6198e60bce1c28
Author: Drew DeVault <sir@cmpwn.com>
Date: Fri, 13 Aug 2021 10:32:38 +0200
gen: branch_copyresult: handle more void cases
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/genutil.c b/src/genutil.c
@@ -102,7 +102,9 @@ branch_copyresult(struct gen_context *ctx,
// Branching expressions written in the _with style may need to
// consolodate each branch's result into a single temporary to return to
// the caller. This function facilitates that.
- if (out || type_dealias(result.type)->storage == STORAGE_VOID) {
+ if (out
+ || type_dealias(merged.type)->storage == STORAGE_VOID
+ || type_dealias(result.type)->storage == STORAGE_VOID) {
return;
}
struct qbe_value qmerged = mkqval(ctx, &merged);