diff options
| author | Kostya Serebryany <kcc@google.com> | 2014-10-17 21:02:13 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2014-10-17 21:02:13 +0000 |
| commit | 644492139ff0ac3c013f44244819105cb8e05df1 (patch) | |
| tree | 815dd20a30c096ce194c45fcd23008b6bda6474c /clang/lib/CodeGen/CGClass.cpp | |
| parent | bc2e9718032727cc26dd9f589d7548e07d380f9d (diff) | |
| download | bcm5719-llvm-644492139ff0ac3c013f44244819105cb8e05df1.tar.gz bcm5719-llvm-644492139ff0ac3c013f44244819105cb8e05df1.zip | |
fix -fsanitize-address-field-padding for the cases with virtual base classes
Summary: Correctly compute the non-virtual size of a class.
Test Plan: Build SPEC 2016 with -fsanitize-address-field-padding
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5848
llvm-svn: 220089
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index d31d50bb4b2..6f2c40af759 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -750,9 +750,7 @@ void CodeGenFunction::EmitAsanPrologueOrEpilogue(bool Prologue) { llvm::Value *ThisPtr = LoadCXXThis(); ThisPtr = Builder.CreatePtrToInt(ThisPtr, IntPtrTy); - QualType RecordTy = Context.getTypeDeclType(ClassDecl); - uint64_t TypeSize = Context.getTypeSizeInChars(RecordTy).getQuantity(); - + uint64_t TypeSize = Info.getNonVirtualSize().getQuantity(); // For each field check if it has sufficient padding, // if so (un)poison it with a call. for (size_t i = 0; i < SSV.size(); i++) { |

