Fix crash with constant initialization of bit-fields in unions.

llvm-svn: 71194
This commit is contained in:
Eli Friedman 2009-05-07 23:42:42 +00:00
parent 9157fbb6a6
commit 7ce29a18e1
2 changed files with 3 additions and 1 deletions

View File

@ -275,7 +275,7 @@ public:
if (curField->isBitField()) {
// Create a dummy struct for bit-field insertion
unsigned NumElts = CGM.getTargetData().getTypePaddedSize(Ty) / 8;
unsigned NumElts = CGM.getTargetData().getTypePaddedSize(Ty);
llvm::Constant* NV = llvm::Constant::getNullValue(llvm::Type::Int8Ty);
std::vector<llvm::Constant*> Elts(NumElts, NV);

View File

@ -10,3 +10,5 @@ void sqlite3CodeSubselect(){
struct Token one = { 1 };
}
typedef union T0 { char field0 : 2; } T0;
T0 T0_values = { 0 };