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
This commit is contained in:
Veikka Tuominen
2022-11-08 19:31:09 +02:00
parent c4465556fd
commit d2cc55109a
2 changed files with 22 additions and 2 deletions

View File

@@ -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,