gcc/libsanitizer/ubsan/ubsan_checks.inc
Max Ostapenko 696d846a56 libsanitizer merge from upstream r250806.
libsanitizer/

2015-10-20  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

	* All source files: Merge from upstream r250806.
	* configure.ac (link_sanitizer_common): Add -lrt flag.
	* configure.tgt: Enable TSAN and LSAN for aarch64-linux targets.
	Set CXX_ABI_NEEDED=true for darwin.
	* asan/Makefile.am (asan_files): Add new files.
	(DEFS): Add DCAN_SANITIZE_UB=0 and remove unused and legacy
	DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0.
	* asan/Makefile.in: Regenerate.
	* ubsan/Makefile.am (ubsan_files): Add new files.
	(DEFS): Add DCAN_SANITIZE_UB=1.
	(libubsan_la_LIBADD): Add -lc++abi if CXX_ABI_NEEDED is true.
	* ubsan/Makefile.in: Regenerate.
	* tsan/Makefile.am (tsan_files): Add new files.
	(DEFS): Add DCAN_SANITIZE_UB=0.
	* tsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.am (sanitizer_common_files): Add new files.
	* sanitizer_common/Makefile.in: Regenerate.
	* asan/libtool-version: Bump the libasan SONAME.

From-SVN: r229111
2015-10-21 10:32:45 +03:00

52 lines
2.5 KiB
C++

//===-- ubsan_checks.inc ----------------------------------------*- C++ -*-===//
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// List of checks handled by UBSan runtime.
//
//===----------------------------------------------------------------------===//
#ifndef UBSAN_CHECK
# error "Define UBSAN_CHECK prior to including this file!"
#endif
// UBSAN_CHECK(Name, SummaryKind, FlagName)
// SummaryKind and FlagName should be string literals.
UBSAN_CHECK(GenericUB, "undefined-behavior", "-fsanitize=undefined")
UBSAN_CHECK(NullPointerUse, "null-pointer-use", "-fsanitize=null")
UBSAN_CHECK(MisalignedPointerUse, "misaligned-pointer-use",
"-fsanitize=alignment")
UBSAN_CHECK(InsufficientObjectSize, "insufficient-object-size",
"-fsanitize=object-size")
UBSAN_CHECK(SignedIntegerOverflow, "signed-integer-overflow",
"-fsanitize=signed-integer-overflow")
UBSAN_CHECK(UnsignedIntegerOverflow, "unsigned-integer-overflow",
"-fsanitize=unsigned-integer-overflow")
UBSAN_CHECK(IntegerDivideByZero, "integer-divide-by-zero",
"-fsanitize=integer-divide-by-zero")
UBSAN_CHECK(FloatDivideByZero, "float-divide-by-zero",
"-fsanitize=float-divide-by-zero")
UBSAN_CHECK(InvalidShiftBase, "invalid-shift-base", "-fsanitize=shift-base")
UBSAN_CHECK(InvalidShiftExponent, "invalid-shift-exponent",
"-fsanitize=shift-exponent")
UBSAN_CHECK(OutOfBoundsIndex, "out-of-bounds-index", "-fsanitize=bounds")
UBSAN_CHECK(UnreachableCall, "unreachable-call", "-fsanitize=unreachable")
UBSAN_CHECK(MissingReturn, "missing-return", "-fsanitize=return")
UBSAN_CHECK(NonPositiveVLAIndex, "non-positive-vla-index",
"-fsanitize=vla-bound")
UBSAN_CHECK(FloatCastOverflow, "float-cast-overflow",
"-fsanitize=float-cast-overflow")
UBSAN_CHECK(InvalidBoolLoad, "invalid-bool-load", "-fsanitize=bool")
UBSAN_CHECK(InvalidEnumLoad, "invalid-enum-load", "-fsanitize=enum")
UBSAN_CHECK(FunctionTypeMismatch, "function-type-mismatch",
"-fsanitize=function")
UBSAN_CHECK(InvalidNullReturn, "invalid-null-return",
"-fsanitize=returns-nonnull-attribute")
UBSAN_CHECK(InvalidNullArgument, "invalid-null-argument",
"-fsanitize=nonnull-attribute")
UBSAN_CHECK(DynamicTypeMismatch, "dynamic-type-mismatch", "-fsanitize=vptr")
UBSAN_CHECK(CFIBadType, "cfi-bad-type", "-fsanitize=cfi")