• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
20UBSAN_CHECK(GenericUB, "undefined-behavior", "undefined")
21UBSAN_CHECK(NullPointerUse, "null-pointer-use", "null")
22UBSAN_CHECK(MisalignedPointerUse, "misaligned-pointer-use", "alignment")
23UBSAN_CHECK(InsufficientObjectSize, "insufficient-object-size", "object-size")
24UBSAN_CHECK(SignedIntegerOverflow, "signed-integer-overflow",
25            "signed-integer-overflow")
26UBSAN_CHECK(UnsignedIntegerOverflow, "unsigned-integer-overflow",
27            "unsigned-integer-overflow")
28UBSAN_CHECK(IntegerDivideByZero, "integer-divide-by-zero",
29            "integer-divide-by-zero")
30UBSAN_CHECK(FloatDivideByZero, "float-divide-by-zero", "float-divide-by-zero")
31UBSAN_CHECK(InvalidShiftBase, "invalid-shift-base", "shift-base")
32UBSAN_CHECK(InvalidShiftExponent, "invalid-shift-exponent", "shift-exponent")
33UBSAN_CHECK(OutOfBoundsIndex, "out-of-bounds-index", "bounds")
34UBSAN_CHECK(UnreachableCall, "unreachable-call", "unreachable")
35UBSAN_CHECK(MissingReturn, "missing-return", "return")
36UBSAN_CHECK(NonPositiveVLAIndex, "non-positive-vla-index", "vla-bound")
37UBSAN_CHECK(FloatCastOverflow, "float-cast-overflow", "float-cast-overflow")
38UBSAN_CHECK(InvalidBoolLoad, "invalid-bool-load", "bool")
39UBSAN_CHECK(InvalidEnumLoad, "invalid-enum-load", "enum")
40UBSAN_CHECK(FunctionTypeMismatch, "function-type-mismatch", "function")
41UBSAN_CHECK(InvalidNullReturn, "invalid-null-return",
42            "returns-nonnull-attribute")
43UBSAN_CHECK(InvalidNullArgument, "invalid-null-argument", "nonnull-attribute")
44UBSAN_CHECK(DynamicTypeMismatch, "dynamic-type-mismatch", "vptr")
45UBSAN_CHECK(CFIBadType, "cfi-bad-type", "cfi")
46