| ... | ... | @@ -14363,19 +14363,22 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, ResultLoc *result_loc, Z |
| 14363 | 14363 | IrInstructionAllocaSrc *alloca_src = |
| 14364 | 14364 | reinterpret_cast<IrInstructionAllocaSrc *>(result_loc->source_instruction); |
| 14365 | 14365 | if (alloca_src->base.child == nullptr) { |
| 14366 | | bool is_comptime = value != nullptr && value->value.special != ConstValSpecialRuntime && |
| 14367 | | result_loc_var->var->gen_is_const; |
| 14366 | bool force_comptime; |
| 14367 | if (!ir_resolve_comptime(ira, alloca_src->is_comptime->child, &force_comptime)) |
| 14368 | return ira->codegen->invalid_instruction; |
| 14369 | bool is_comptime = force_comptime || (value != nullptr && |
| 14370 | value->value.special != ConstValSpecialRuntime && result_loc_var->var->gen_is_const); |
| 14371 | uint32_t align = 0; |
| 14372 | if (alloca_src->align != nullptr && !ir_resolve_align(ira, alloca_src->align->child, &align)) { |
| 14373 | return ira->codegen->invalid_instruction; |
| 14374 | } |
| 14368 | 14375 | IrInstruction *alloca_gen; |
| 14369 | 14376 | if (is_comptime) { |
| 14377 | if (align > value->value.global_refs->align) { |
| 14378 | value->value.global_refs->align = align; |
| 14379 | } |
| 14370 | 14380 | alloca_gen = ir_get_ref(ira, result_loc->source_instruction, value, true, false); |
| 14371 | 14381 | } else { |
| 14372 | | uint32_t align = 0; |
| 14373 | | if (alloca_src->align != nullptr && !ir_resolve_align(ira, alloca_src->align->child, &align)) { |
| 14374 | | return ira->codegen->invalid_instruction; |
| 14375 | | } |
| 14376 | | bool force_comptime; |
| 14377 | | if (!ir_resolve_comptime(ira, alloca_src->is_comptime->child, &force_comptime)) |
| 14378 | | return ira->codegen->invalid_instruction; |
| 14379 | 14382 | alloca_gen = ir_analyze_alloca(ira, result_loc->source_instruction, value_type, align, |
| 14380 | 14383 | alloca_src->name_hint, force_comptime); |
| 14381 | 14384 | } |