commit 65b7d2b4e1b82e98410520cbcfa029b205a37d92 (tree)
parent ffc8a43dfb6a44f4355693b5b1dae4712e0484d8
Author: LemonBoy <thatlemon@gmail.com>
Date: Tue, 12 Jan 2021 12:32:27 +0100
stage1: Resolve alignment earlier in @alignCast
Fixes #7744
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/stage1/ir.cpp b/src/stage1/ir.cpp
@@ -30093,9 +30093,9 @@ static IrInstGen *ir_align_cast(IrAnalyze *ira, IrInstGen *target, uint32_t alig
}
if (target_type->id == ZigTypeIdPointer) {
- result_type = adjust_ptr_align(ira->codegen, target_type, align_bytes);
if ((err = resolve_ptr_align(ira, target_type, &old_align_bytes)))
return ira->codegen->invalid_inst_gen;
+ result_type = adjust_ptr_align(ira->codegen, target_type, align_bytes);
} else if (target_type->id == ZigTypeIdFn) {
FnTypeId fn_type_id = target_type->data.fn.fn_type_id;
old_align_bytes = fn_type_id.alignment;