]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/ubsan/ubsan_checks.inc
Merge compiler-rt trunk r351319, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / ubsan / ubsan_checks.inc
1 //===-- ubsan_checks.inc ----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // List of checks handled by UBSan runtime.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef UBSAN_CHECK
14 # error "Define UBSAN_CHECK prior to including this file!"
15 #endif
16
17 // UBSAN_CHECK(Name, SummaryKind, FSanitizeFlagName)
18 // SummaryKind and FSanitizeFlagName should be string literals.
19
20 UBSAN_CHECK(GenericUB, "undefined-behavior", "undefined")
21 UBSAN_CHECK(NullPointerUse, "null-pointer-use", "null")
22 UBSAN_CHECK(PointerOverflow, "pointer-overflow", "pointer-overflow")
23 UBSAN_CHECK(MisalignedPointerUse, "misaligned-pointer-use", "alignment")
24 UBSAN_CHECK(AlignmentAssumption, "alignment-assumption", "alignment")
25 UBSAN_CHECK(InsufficientObjectSize, "insufficient-object-size", "object-size")
26 UBSAN_CHECK(SignedIntegerOverflow, "signed-integer-overflow",
27             "signed-integer-overflow")
28 UBSAN_CHECK(UnsignedIntegerOverflow, "unsigned-integer-overflow",
29             "unsigned-integer-overflow")
30 UBSAN_CHECK(IntegerDivideByZero, "integer-divide-by-zero",
31             "integer-divide-by-zero")
32 UBSAN_CHECK(FloatDivideByZero, "float-divide-by-zero", "float-divide-by-zero")
33 UBSAN_CHECK(InvalidBuiltin, "invalid-builtin-use", "invalid-builtin-use")
34 UBSAN_CHECK(ImplicitUnsignedIntegerTruncation,
35             "implicit-unsigned-integer-truncation",
36             "implicit-unsigned-integer-truncation")
37 UBSAN_CHECK(ImplicitSignedIntegerTruncation,
38             "implicit-signed-integer-truncation",
39             "implicit-signed-integer-truncation")
40 UBSAN_CHECK(ImplicitIntegerSignChange,
41             "implicit-integer-sign-change",
42             "implicit-integer-sign-change")
43 UBSAN_CHECK(ImplicitSignedIntegerTruncationOrSignChange,
44             "implicit-signed-integer-truncation-or-sign-change",
45             "implicit-signed-integer-truncation,implicit-integer-sign-change")
46 UBSAN_CHECK(InvalidShiftBase, "invalid-shift-base", "shift-base")
47 UBSAN_CHECK(InvalidShiftExponent, "invalid-shift-exponent", "shift-exponent")
48 UBSAN_CHECK(OutOfBoundsIndex, "out-of-bounds-index", "bounds")
49 UBSAN_CHECK(UnreachableCall, "unreachable-call", "unreachable")
50 UBSAN_CHECK(MissingReturn, "missing-return", "return")
51 UBSAN_CHECK(NonPositiveVLAIndex, "non-positive-vla-index", "vla-bound")
52 UBSAN_CHECK(FloatCastOverflow, "float-cast-overflow", "float-cast-overflow")
53 UBSAN_CHECK(InvalidBoolLoad, "invalid-bool-load", "bool")
54 UBSAN_CHECK(InvalidEnumLoad, "invalid-enum-load", "enum")
55 UBSAN_CHECK(FunctionTypeMismatch, "function-type-mismatch", "function")
56 UBSAN_CHECK(InvalidNullReturn, "invalid-null-return",
57             "returns-nonnull-attribute")
58 UBSAN_CHECK(InvalidNullArgument, "invalid-null-argument", "nonnull-attribute")
59 UBSAN_CHECK(DynamicTypeMismatch, "dynamic-type-mismatch", "vptr")
60 UBSAN_CHECK(CFIBadType, "cfi-bad-type", "cfi")