mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
Sema: resolve elem type for non-default aligned ptrs
Before this commit, I observe a crash from this abiSize call because the element type is a struct that is not yet resolved. This is triggered by running the behavior tests with -ofmt=c -target x86_64-windows.
This commit is contained in:
parent
f8f65aebe6
commit
bb957a976d
@ -32405,7 +32405,7 @@ fn elemPtrType(sema: *Sema, ptr_ty: Type, offset: ?usize) !Type {
|
||||
}
|
||||
// If the addend is not a comptime-known value we can still count on
|
||||
// it being a multiple of the type size.
|
||||
const elem_size = elem_ty.abiSize(target);
|
||||
const elem_size = try sema.typeAbiSize(elem_ty);
|
||||
const addend = if (offset) |off| elem_size * off else elem_size;
|
||||
|
||||
// The resulting pointer is aligned to the lcd between the offset (an
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user