mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-05-21 16:41:56 +03:00
Sema: fix empty slice pointer value
We just checked that inst_child_ty was effectively a zero-bit type, so it is certainly not the non-zero alignment we are looking for. Closes #15085
This commit is contained in:
committed by
Veikka Tuominen
parent
2b80552603
commit
dd66e0addb
+1
-1
@@ -1069,7 +1069,7 @@ pub const DeclGen = struct {
|
||||
const extern_fn = val.castTag(.extern_fn).?.data;
|
||||
try dg.renderDeclName(writer, extern_fn.owner_decl, 0);
|
||||
},
|
||||
.int_u64, .one => {
|
||||
.int_u64, .one, .int_big_positive, .lazy_align, .lazy_size => {
|
||||
try writer.writeAll("((");
|
||||
try dg.renderType(writer, ty);
|
||||
return writer.print("){x})", .{try dg.fmtIntLiteral(Type.usize, val, .Other)});
|
||||
|
||||
@@ -3397,7 +3397,7 @@ pub const DeclGen = struct {
|
||||
};
|
||||
return dg.context.constStruct(&fields, fields.len, .False);
|
||||
},
|
||||
.int_u64, .one, .int_big_positive => {
|
||||
.int_u64, .one, .int_big_positive, .lazy_align, .lazy_size => {
|
||||
const llvm_usize = try dg.lowerType(Type.usize);
|
||||
const llvm_int = llvm_usize.constInt(tv.val.toUnsignedInt(target), .False);
|
||||
return llvm_int.constIntToPtr(try dg.lowerType(tv.ty));
|
||||
|
||||
Reference in New Issue
Block a user