]> git.ipfire.org Git - thirdparty/gcc.git/commit
* ubsan.c (ubsan_source_location): Don't crash on
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Nov 2013 20:07:31 +0000 (20:07 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Nov 2013 20:07:31 +0000 (20:07 +0000)
commit020bc656ab7a62b27ac7216a559a2e41e645e833
tree27f73f1a16fc3ef2b2d49ac81210b2c02c06ba3f
parent085f6ebf2c482e7e734c5abc54597ecc99c18c1f
* ubsan.c (ubsan_source_location): Don't crash on
unknown locations.
(ubsan_pass): Ignore clobber stmts.

* sanitizer.def (BUILT_IN_UBSAN_HANDLE_MISSING_RETURN): New built-in.
* opts.c (common_handle_option): Add -fsanitize=return.
* flag-types.h (enum sanitize_code): Add SANITIZE_RETURN and
or it into SANITIZE_UNDEFINED.
c-family/
* c-ubsan.h (ubsan_instrument_return): New prototype.
* c-ubsan.c (ubsan_instrument_return): New function.
cp/
* cp-gimplify.c: Include target.h and c-family/c-ubsan.h.
(cp_ubsan_maybe_instrument_return): New function.
(cp_genericize): Call it if -fsanitize=return.
testsuite/
* g++.dg/ubsan/return-1.C: New test.
* g++.dg/ubsan/return-2.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205283 138bc75d-0d04-0410-961f-82ee72b054a4
13 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-ubsan.c
gcc/c-family/c-ubsan.h
gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/flag-types.h
gcc/opts.c
gcc/sanitizer.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ubsan/return-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ubsan/return-2.C [new file with mode: 0644]
gcc/ubsan.c