aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-08-27 10:14:11 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-08-27 10:14:11 -0400
commitffac0b02e75c9c620df11201ee70965856ba9ebf (patch)
tree3f8ccf411b164f6a371bff14d2b12130a7b5069a /src/analyze.cpp
parenta2e8ef77e2087e26c1449c56ad16efcea71679db (diff)
downloadzig-ffac0b02e75c9c620df11201ee70965856ba9ebf.tar.gz
zig-ffac0b02e75c9c620df11201ee70965856ba9ebf.zip
implement and test struct field explicit alignment
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index f1df64b17e..247788b949 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -1896,9 +1896,9 @@ static Error resolve_struct_type(CodeGen *g, ZigType *struct_type) {
break;
}
}
- size_t next_abi_align = (next_src_field_index == field_count) ?
- abi_align : struct_type->data.structure.fields[next_src_field_index].type_entry->abi_align;
- next_offset = next_field_offset(next_offset, abi_align, field_type->abi_size, next_abi_align);
+ size_t next_align = (next_src_field_index == field_count) ?
+ abi_align : struct_type->data.structure.fields[next_src_field_index].align;
+ next_offset = next_field_offset(next_offset, abi_align, field_type->abi_size, next_align);
size_in_bits = next_offset * 8;
}
}