mirror of
https://github.com/ziglang/zig.git
synced 2026-01-12 02:15:12 +00:00
compiler: fix compilation for 32-bit targets
This commit is contained in:
parent
2e5d13e9cf
commit
55bc8a7fa9
@ -6657,7 +6657,7 @@ pub fn structFieldAlignmentExtern(mod: *Module, field_ty: Type) Alignment {
|
||||
pub fn structPackedFieldBitOffset(
|
||||
mod: *Module,
|
||||
struct_type: InternPool.Key.StructType,
|
||||
field_index: usize,
|
||||
field_index: u32,
|
||||
) u16 {
|
||||
const ip = &mod.intern_pool;
|
||||
assert(struct_type.layout == .Packed);
|
||||
|
||||
@ -11426,7 +11426,8 @@ fn airAggregateInit(self: *Self, inst: Air.Inst.Index) !void {
|
||||
.{ .immediate = 0 },
|
||||
.{ .immediate = result_ty.abiSize(mod) },
|
||||
);
|
||||
for (elements, 0..) |elem, elem_i| {
|
||||
for (elements, 0..) |elem, elem_i_usize| {
|
||||
const elem_i: u32 = @intCast(elem_i_usize);
|
||||
if ((try result_ty.structFieldValueComptime(mod, elem_i)) != null) continue;
|
||||
|
||||
const elem_ty = result_ty.structFieldType(elem_i, mod);
|
||||
|
||||
@ -705,7 +705,7 @@ fn lowerParentPtr(
|
||||
.Packed => if (mod.typeToStruct(base_type.toType())) |struct_type|
|
||||
math.divExact(u16, mod.structPackedFieldBitOffset(
|
||||
struct_type,
|
||||
field.index,
|
||||
@intCast(field.index),
|
||||
), 8) catch |err| switch (err) {
|
||||
error.UnexpectedRemainder => 0,
|
||||
error.DivisionByZero => unreachable,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user