summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-16 21:02:32 +0000
committerChris Lattner <sabre@nondot.org>2010-04-16 21:02:32 +0000
commit3cff64ab58d164653c4adf7f78cdc7ca07310f9f (patch)
treef3657588cca39b6b52e5bd59327a89f79b742ae4 /clang/lib/CodeGen/CGExprConstant.cpp
parent5863c999e7a0488cca94786bf62e7b4c69fd82c2 (diff)
downloadbcm5719-llvm-3cff64ab58d164653c4adf7f78cdc7ca07310f9f.tar.gz
bcm5719-llvm-3cff64ab58d164653c4adf7f78cdc7ca07310f9f.zip
fix a bogus assertion exposed by a recent change: packing the
struct may cause it to shrink more than one byte. Before my recent changes we compiled the new test into: %0 = type { [6 x i8] } @x = global %0 { [6 x i8] undef }, align 2 ; <%0*> [#uses=0] which is obviously bogus. Now we compile it into: %0 = type <{ i32, i8, i8 }> @x = global %0 zeroinitializer, align 2 ; <%0*> [#uses=0] Where the last byte only is tail padding. llvm-svn: 101536
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 52e7d045e60..82156f72602 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -372,7 +372,7 @@ bool ConstStructBuilder::Build(InitListExpr *ILE) {
assert(!Packed && "Size mismatch!");
ConvertStructToPacked();
- assert(NextFieldOffsetInBytes == LayoutSizeInBytes &&
+ assert(NextFieldOffsetInBytes <= LayoutSizeInBytes &&
"Converting to packed did not help!");
}
OpenPOWER on IntegriCloud