diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-12-15 18:49:47 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-12-15 18:49:47 +0000 |
commit | 34d02d0b37f16015f317a935c48ce8b7b64ae77b (patch) | |
tree | 2fd5819f49caecc5f520219b6b9254fe94ebb138 /lib/CodeGen/CGExprConstant.cpp | |
parent | 1569ce68681d909594d64f9b056d71f5dd7563bf (diff) |
Notes
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 9289f78d557a..d428983f012a 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -167,7 +167,11 @@ class ConstStructBuilder { } // Or in the bits that go into the previous byte. - Tmp |= cast<llvm::ConstantInt>(Elements.back())->getValue(); + if (llvm::ConstantInt *Val = dyn_cast<llvm::ConstantInt>(Elements.back())) + Tmp |= Val->getValue(); + else + assert(isa<llvm::UndefValue>(Elements.back())); + Elements.back() = llvm::ConstantInt::get(CGM.getLLVMContext(), Tmp); if (FitsCompletelyInPreviousByte) |