summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/expression_command
diff options
context:
space:
mode:
authorRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-07-14 14:10:43 +0000
committerRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-07-14 14:10:43 +0000
commit585ea9ddce50f3c3d3fd6dae0f9f148c074bcc2b (patch)
tree593b9ea27e27c3a09deeee2fc0b2aab774b8a5bd /lldb/packages/Python/lldbsuite/test/expression_command
parent34be2a0a61ac79eae1dd0f88f022063fba55bcbb (diff)
downloadbcm5719-llvm-585ea9ddce50f3c3d3fd6dae0f9f148c074bcc2b.tar.gz
bcm5719-llvm-585ea9ddce50f3c3d3fd6dae0f9f148c074bcc2b.zip
Diagnose taking address and reference binding of packed members
This patch implements PR#22821. Taking the address of a packed member is dangerous since the reduced alignment of the pointee is lost. This can lead to memory alignment faults in some architectures if the pointer value is dereferenced. This change adds a new warning to clang emitted when taking the address of a packed member. A packed member is either a field/data member declared as attribute((packed)) or belonging to a struct/class declared as such. The associated flag is -Waddress-of-packed-member. Conversions (either implicit or via a valid casting) to pointer types with lower or equal alignment requirements (e.g. void* or char*) silence the warning. This change also adds a new error diagnostic when the user attempts to bind a reference to a packed member, regardless of the alignment. Differential Revision: https://reviews.llvm.org/D20561 llvm-svn: 275417
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud