summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/sanitize-address-field-padding.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix test case in r242565Steven Wu2015-07-171-1/+2
| | | | llvm-svn: 242571
* Fix -save-temp when using objc-arc, sanitizer and profilingSteven Wu2015-07-171-0/+1
| | | | | | | | | | | | Currently, -save-temp will cause ObjCARC optimization to be dropped, sanitizer pass to run early in the pipeline, and profiling instrumentation to run twice. Fix the issue by properly disable all passes in the optimization pipeline when generating bitcode output and parse some of the Language Options even when the input is bitcode so the passes can be setup correctly. llvm-svn: 242565
* No memcpy for copy ctor with -fsanitize-address-field-padding=1Kostya Serebryany2014-12-061-0/+1
| | | | | | | | | | | | | | | | | | | Summary: When -fsanitize-address-field-padding=1 is present don't emit memcpy for copy constructor. Thanks Nico for the extra test case. Test Plan: regression tests Reviewers: thakis, rsmith Reviewed By: rsmith Subscribers: rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D6515 llvm-svn: 223563
* [clang/asan] Do not emit memcpy for trivial operator= when ↵Kostya Serebryany2014-11-111-0/+17
| | | | | | | | | | | | | | | | | | -fsanitize-address-field-padding >= 1 Summary: If we've added poisoned paddings to a type do not emit memcpy for operator=. Test Plan: regression tests. Reviewers: majnemer, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6160 llvm-svn: 221739
* Remove "REQUIRES:shell" from tests. They work for me.NAKAMURA Takumi2014-11-041-1/+0
| | | | llvm-svn: 221269
* ignore -mconstructor-aliases when adding field paddings for asanKostya Serebryany2014-10-311-0/+25
| | | | | | | | | | | | | | | | | | Summary: When we are adding field paddings for asan even an empty dtor has to remain in the code, so we ignore -mconstructor-aliases if the paddings are going to be added. Test Plan: added a test Reviewers: rsmith, rnk, rafael Reviewed By: rafael Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6038 llvm-svn: 220986
* Do not insert asan paddings after fields that have flexible arrays.Kostya Serebryany2014-10-271-0/+30
| | | | | | | | | | | | | | | | | | | 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
* fix -fsanitize-address-field-padding for the cases with virtual base classesKostya Serebryany2014-10-171-0/+26
| | | | | | | | | | | | | | | | 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
* Add explicit triple to ↵NAKAMURA Takumi2014-10-171-2/+2
| | | | | | clang/test/CodeGen/sanitize-address-field-padding.cpp, for now. It's incompatible to ms mangling. llvm-svn: 220037
* User c-tor name to fix the sanitizer testRenato Golin2014-10-171-1/+1
| | | | llvm-svn: 220030
* Trying to fix failing Clang sanitizer test on ARM botsRenato Golin2014-10-171-1/+1
| | | | llvm-svn: 220029
* trying to fix the new test again, this time for the clang-cmake-armv7-a15 botKostya Serebryany2014-10-171-16/+3
| | | | llvm-svn: 220002
* trying to fix the new test on hexagon-buildKostya Serebryany2014-10-161-10/+10
| | | | llvm-svn: 219965
* Insert poisoned paddings between fields in C++ classes so that ↵Kostya Serebryany2014-10-161-0/+152
AddressSanitizer can find intra-object-overflow bugs Summary: The general approach is to add extra paddings after every field in AST/RecordLayoutBuilder.cpp, then add code to CTORs/DTORs that poisons the paddings (CodeGen/CGClass.cpp). Everything is done under the flag -fsanitize-address-field-padding. The blacklist file (-fsanitize-blacklist) allows to avoid the transformation for given classes or source files. See also https://code.google.com/p/address-sanitizer/wiki/IntraObjectOverflow Test Plan: run SPEC2006 and some of the Chromium tests with -fsanitize-address-field-padding Reviewers: samsonov, rnk, rsmith Reviewed By: rsmith Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D5687 llvm-svn: 219961
OpenPOWER on IntegriCloud