re PR sanitizer/65280 (-fsanitize=bounds does not detect out-of-bounds access)
authorMarek Polacek <polacek@redhat.com>
Fri, 6 Mar 2015 23:44:56 +0000 (23:44 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Fri, 6 Mar 2015 23:44:56 +0000 (23:44 +0000)
commit04fd785e38c4c37ae4f71704397a27a924baf4d9
tree7064860fcc0879e90d67ecc31bc3d27458bf2a97
parenta78cbe2976549780489d72b895a9adb528ba874b
re PR sanitizer/65280 (-fsanitize=bounds does not detect out-of-bounds access)

PR sanitizer/65280
* doc/invoke.texi: Update description of -fsanitize=bounds.

* c-ubsan.c (ubsan_instrument_bounds): Check for COMPONENT_REF
before trying to figure out whether we have a flexible array member.

* c-c++-common/ubsan/bounds-1.c: Add testing of flexible array
member-like arrays.
* c-c++-common/ubsan/bounds-8.c: New test.
* c-c++-common/ubsan/bounds-9.c: New test.
* gcc.dg/ubsan/bounds-2.c: New test.

Co-Authored-By: Martin Uecker <uecker@eecs.berkeley.edu>
From-SVN: r221250
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-ubsan.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/ubsan/bounds-1.c
gcc/testsuite/c-c++-common/ubsan/bounds-8.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/ubsan/bounds-9.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/ubsan/bounds-2.c [new file with mode: 0644]