Do not insert asan paddings after fields that have flexible arrays.
authorKostya Serebryany <kcc@google.com>
Mon, 27 Oct 2014 19:34:10 +0000 (19:34 +0000)
committerKostya Serebryany <kcc@google.com>
Mon, 27 Oct 2014 19:34:10 +0000 (19:34 +0000)
commit68c29da4c5a6e3f5443c3b2bfc0ee6d2f44002c8
tree05caadf46f08fe3ea8eb742f9aedd478550c6571
parentaae76493f0d5d8c2858ea70f950366feb759d9ab
Do not insert asan paddings after fields that have flexible arrays.

Summary:
We should avoid a tail padding not only if the last field
has zero size but also if the last field is a struct with a flexible array.

If/when http://reviews.llvm.org/D5478 is committed,
this will also handle the case of structs with zero-sized arrays.

Reviewers: majnemer, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5924

llvm-svn: 220708
clang/lib/AST/RecordLayoutBuilder.cpp
clang/test/CodeGen/sanitize-address-field-padding.cpp