From 3c8bbc2b90cb60c5b03c42f82476c06af2d64bd4 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sun, 13 Aug 2023 20:34:52 +0200 Subject: [PATCH] Fix issue combining void! in macros in some cases. See #927 --- src/compiler/llvm_codegen_expr.c | 5 ++--- src/version.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/compiler/llvm_codegen_expr.c b/src/compiler/llvm_codegen_expr.c index b1a52c035..c10c188f7 100644 --- a/src/compiler/llvm_codegen_expr.c +++ b/src/compiler/llvm_codegen_expr.c @@ -5851,8 +5851,7 @@ static inline void llvm_emit_return_block(GenContext *c, BEValue *be_value, Type *block_exit= &exit; - - if (type_no_optional(type_lowered) != type_void) + if (type_lowered != type_void) { exit.block_return_out = llvm_emit_alloca_aligned(c, type_lowered, "blockret"); } @@ -5890,7 +5889,7 @@ static inline void llvm_emit_return_block(GenContext *c, BEValue *be_value, Type } // return foo() where foo() is a void! - if (type_no_optional(type_flatten(ret_expr->type)) == type_void) break; + if (type_lowering(ret_expr->type) == type_void) break; LLVMInstructionEraseFromParent(exit.block_return_out); diff --git a/src/version.h b/src/version.h index 0111e7739..b32561722 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define COMPILER_VERSION "0.4.606" \ No newline at end of file +#define COMPILER_VERSION "0.4.607" \ No newline at end of file