summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/RecordLayoutBuilder.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-10-14 21:14:05 +0000
committerReid Kleckner <reid@kleckner.net>2013-10-14 21:14:05 +0000
commitbd5bd4b36a207a98c8433462701e48a4aa5a05a4 (patch)
treeb7ab3cf574be6d0dffeb70aa4269515509d32fbf /clang/lib/AST/RecordLayoutBuilder.cpp
parente896819033434f0da3cd4831f2c14cdae1ce8719 (diff)
downloadbcm5719-llvm-bd5bd4b36a207a98c8433462701e48a4aa5a05a4.tar.gz
bcm5719-llvm-bd5bd4b36a207a98c8433462701e48a4aa5a05a4.zip
PR17576: Fix assertion on polymorphic classes with small alignment
We have to reserve at least the width of a pointer for the vfptr. For classes with small alignment, we weren't reserving enough space, and were overlapping the first field with the vfptr. llvm-svn: 192626
Diffstat (limited to 'clang/lib/AST/RecordLayoutBuilder.cpp')
-rw-r--r--clang/lib/AST/RecordLayoutBuilder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp
index 05eeae154d0..b0230ac6ef6 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -2660,8 +2660,8 @@ void MicrosoftRecordLayoutBuilder::layoutVFPtr(const CXXRecordDecl *RD) {
// the max alignment of all the non-virtual data in the class. The resulting
// layout is essentially { vftbl, { nvdata } }. This is completely
// unnecessary, but we're not here to pass judgment.
- Size += Alignment;
updateAlignment(PointerAlignment);
+ Size += Alignment;
}
void
OpenPOWER on IntegriCloud