mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 23:23:07 +00:00
fix regression in global const alignment
This commit is contained in:
parent
fbcee58cfc
commit
b6c8fead00
@ -9303,7 +9303,9 @@ bool type_has_optional_repr(ZigType *ty) {
|
||||
}
|
||||
|
||||
void copy_const_val(ZigValue *dest, ZigValue *src) {
|
||||
uint32_t prev_align = dest->llvm_align;
|
||||
memcpy(dest, src, sizeof(ZigValue));
|
||||
dest->llvm_align = prev_align;
|
||||
if (src->special != ConstValSpecialStatic)
|
||||
return;
|
||||
dest->parent.id = ConstParentIdNone;
|
||||
|
||||
@ -17052,6 +17052,7 @@ static IrInstruction *ir_analyze_alloca(IrAnalyze *ira, IrInstruction *source_in
|
||||
|
||||
ZigValue *pointee = create_const_vals(1);
|
||||
pointee->special = ConstValSpecialUndef;
|
||||
pointee->llvm_align = align;
|
||||
|
||||
IrInstructionAllocaGen *result = ir_build_alloca_gen(ira, source_inst, align, name_hint);
|
||||
result->base.value->special = ConstValSpecialStatic;
|
||||
|
||||
@ -24,7 +24,7 @@ comptime {
|
||||
_ = @import("behavior/bugs/1500.zig");
|
||||
_ = @import("behavior/bugs/1607.zig");
|
||||
_ = @import("behavior/bugs/1735.zig");
|
||||
//_ = @import("behavior/bugs/1741.zig");
|
||||
_ = @import("behavior/bugs/1741.zig");
|
||||
_ = @import("behavior/bugs/1851.zig");
|
||||
_ = @import("behavior/bugs/1914.zig");
|
||||
_ = @import("behavior/bugs/2006.zig");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user