re PR sanitizer/65081 (-fsanitize=object-size fails with simple pointer arithm)
authorMarek Polacek <polacek@redhat.com>
Wed, 18 Feb 2015 09:46:59 +0000 (09:46 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 18 Feb 2015 09:46:59 +0000 (09:46 +0000)
commitc7400e2fecfd0cc44c553517a59f8a70951cf6cf
treec5459558a64da41ec0b46a0be7dff9d59065c89c
parentd77052881bc8f8a79f195a3859719c517d5aa9ad
re PR sanitizer/65081 (-fsanitize=object-size fails with simple pointer arithm)

PR sanitizer/65081
* ubsan.c (OBJSZ_MAX_OFFSET): Define.
(ubsan_expand_objsize_ifn): Don't emit run-time check if the offset
is in range [-16K, -1].  Don't issue run-time error if
(ptr > ptr + offset).

* c-c++-common/ubsan/pr65081.c: New test.

From-SVN: r220784
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/ubsan/pr65081.c [new file with mode: 0644]
gcc/ubsan.c