]> granicus.if.org Git - clang/commit
[CodeGen] Fix an assertion failure in CGRecordLowering.
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 1 Feb 2018 03:04:15 +0000 (03:04 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Thu, 1 Feb 2018 03:04:15 +0000 (03:04 +0000)
commit2cbd32574f151cbd67c1644b67f1cf7eea3fc18d
tree70701aadb00355ee9d57c1dea65ad8e693b11b9e
parentea016449cc09bda656bc2b3ad643365b307df8dd
[CodeGen] Fix an assertion failure in CGRecordLowering.

This patch fixes a bug in CGRecordLowering::accumulateBitFields where it
unconditionally starts a new run and emits a storage field when it sees
a zero-sized bitfield, which causes an assertion in insertPadding to
fail when -fno-bitfield-type-align is used.

It shouldn't emit new storage if UseZeroLengthBitfieldAlignment and
UseBitFieldTypeAlignment are both false.

rdar://problem/36762205

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323943 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGRecordLayoutBuilder.cpp
test/CodeGen/no-bitfield-type-align.c [new file with mode: 0644]