diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-10-14 21:14:05 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-10-14 21:14:05 +0000 |
commit | bd5bd4b36a207a98c8433462701e48a4aa5a05a4 (patch) | |
tree | b7ab3cf574be6d0dffeb70aa4269515509d32fbf /clang/lib/AST/RecordLayoutBuilder.cpp | |
parent | e896819033434f0da3cd4831f2c14cdae1ce8719 (diff) | |
download | bcm5719-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.cpp | 2 |
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 |