- Eager evaluation of macro arguments would break inferred arrays on some platforms. #2771.

This commit is contained in:
Christoffer Lerno
2026-01-20 13:02:14 +01:00
parent 61e84e4d34
commit 5390ca6250
3 changed files with 3 additions and 1 deletions

View File

@@ -85,6 +85,7 @@
- Comparing an uint and int[<4>] was incorrectly assumed to be uint compared to int, causing a crash instead of an error. #2771 - Comparing an uint and int[<4>] was incorrectly assumed to be uint compared to int, causing a crash instead of an error. #2771
- When an `int[*][6]` was given too few values, the compiler would assert instead of giving an error. #2771 - When an `int[*][6]` was given too few values, the compiler would assert instead of giving an error. #2771
- Inferring length from a slice was accidentally not an error. - Inferring length from a slice was accidentally not an error.
- Eager evaluation of macro arguments would break inferred arrays on some platforms. #2771.
### Stdlib changes ### Stdlib changes
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads. - Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.

View File

@@ -6278,6 +6278,7 @@ static inline void llvm_emit_macro_block(GenContext *c, BEValue *be_value, Expr
BEValue value; BEValue value;
c->debug.block_stack = old_inline_location; c->debug.block_stack = old_inline_location;
llvm_emit_expr(c, &value, init_expr); llvm_emit_expr(c, &value, init_expr);
if (!val->alignment) val->alignment = type_abi_alignment(val->type);
if (llvm_value_is_addr(&value) || val->var.is_written || val->var.is_addr || llvm_use_accurate_debug_info(c)) if (llvm_value_is_addr(&value) || val->var.is_written || val->var.is_addr || llvm_use_accurate_debug_info(c))
{ {
c->debug.block_stack = inline_location; c->debug.block_stack = inline_location;

View File

@@ -1451,7 +1451,7 @@ static inline bool sema_analyse_signature(SemaContext *context, Signature *sig,
{ {
if (!sema_deep_resolve_function_ptr(context, type_info)) return false; if (!sema_deep_resolve_function_ptr(context, type_info)) return false;
param->type = type_info->type; param->type = type_info->type;
if (!sema_set_alignment(context, param->type, &param->alignment, true)) return false; if (!is_macro && !sema_set_alignment(context, param->type, &param->alignment, true)) return false;
} }
if (param->var.init_expr) if (param->var.init_expr)