mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix issue combining void! in macros in some cases. See #927
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user