aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-11-08 19:31:09 +0200
committerVeikka Tuominen <git@vexu.eu>2022-11-11 17:59:53 +0200
commitd2cc55109a64aaf004384b942e08e95829b9341f (patch)
treea58057825963288dc93d51c6295b5879611d8493 /src/codegen
parentc4465556fdf14d87f718a7aced5210ec457c1f5a (diff)
downloadzig-d2cc55109a64aaf004384b942e08e95829b9341f.tar.gz
zig-d2cc55109a64aaf004384b942e08e95829b9341f.zip
llvm: correct calculation of index of zero-bit field
If the field comes before any non-zero-bit field then the index of the next field should be returned. Closes #13363
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index b10402cc09..2daad01936 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -10216,7 +10216,7 @@ fn llvmFieldIndex(
llvm_field_index += 1;
}
- if (field_index == i) {
+ if (field_index <= i) {
ptr_pl_buf.* = .{
.data = .{
.pointee_type = field_ty,
@@ -10249,7 +10249,7 @@ fn llvmFieldIndex(
llvm_field_index += 1;
}
- if (field_index == i) {
+ if (field_index <= i) {
ptr_pl_buf.* = .{
.data = .{
.pointee_type = field.ty,