mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
fully specify padding bytes when necessary
This is what I was going for originally - either we understand that LLVM's padding is sufficient, or we do the entire padding ourselves.
This commit is contained in:
parent
67bd0267db
commit
09575bc0d6
@ -7839,7 +7839,7 @@ static void resolve_llvm_types_struct(CodeGen *g, ZigType *struct_type, ResolveS
|
||||
|
||||
assert(next_offset >= llvm_next_offset);
|
||||
if (next_offset > llvm_next_offset) {
|
||||
size_t pad_bytes = next_offset - llvm_next_offset;
|
||||
size_t pad_bytes = next_offset - (field->offset + LLVMStoreSizeOfType(g->target_data_ref, llvm_type));
|
||||
if (pad_bytes != 0) {
|
||||
LLVMTypeRef pad_llvm_type = LLVMArrayType(LLVMInt8Type(), pad_bytes);
|
||||
element_types[gen_field_index] = pad_llvm_type;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user