|
14 | 14 | #define LLVM_CLANG_LIB_CODEGEN_SANITIZER_HANDLER_H |
15 | 15 |
|
16 | 16 | #define LIST_SANITIZER_CHECKS \ |
17 | | - SANITIZER_CHECK(AddOverflow, add_overflow, 0) \ |
18 | | - SANITIZER_CHECK(BuiltinUnreachable, builtin_unreachable, 0) \ |
19 | | - SANITIZER_CHECK(CFICheckFail, cfi_check_fail, 0) \ |
20 | | - SANITIZER_CHECK(DivremOverflow, divrem_overflow, 0) \ |
21 | | - SANITIZER_CHECK(DynamicTypeCacheMiss, dynamic_type_cache_miss, 0) \ |
22 | | - SANITIZER_CHECK(FloatCastOverflow, float_cast_overflow, 0) \ |
23 | | - SANITIZER_CHECK(FunctionTypeMismatch, function_type_mismatch, 0) \ |
24 | | - SANITIZER_CHECK(ImplicitConversion, implicit_conversion, 0) \ |
25 | | - SANITIZER_CHECK(InvalidBuiltin, invalid_builtin, 0) \ |
26 | | - SANITIZER_CHECK(InvalidObjCCast, invalid_objc_cast, 0) \ |
27 | | - SANITIZER_CHECK(LoadInvalidValue, load_invalid_value, 0) \ |
28 | | - SANITIZER_CHECK(MissingReturn, missing_return, 0) \ |
29 | | - SANITIZER_CHECK(MulOverflow, mul_overflow, 0) \ |
30 | | - SANITIZER_CHECK(NegateOverflow, negate_overflow, 0) \ |
31 | | - SANITIZER_CHECK(NullabilityArg, nullability_arg, 0) \ |
32 | | - SANITIZER_CHECK(NullabilityReturn, nullability_return, 1) \ |
33 | | - SANITIZER_CHECK(NonnullArg, nonnull_arg, 0) \ |
34 | | - SANITIZER_CHECK(NonnullReturn, nonnull_return, 1) \ |
35 | | - SANITIZER_CHECK(OutOfBounds, out_of_bounds, 0) \ |
36 | | - SANITIZER_CHECK(PointerOverflow, pointer_overflow, 0) \ |
37 | | - SANITIZER_CHECK(ShiftOutOfBounds, shift_out_of_bounds, 0) \ |
38 | | - SANITIZER_CHECK(SubOverflow, sub_overflow, 0) \ |
39 | | - SANITIZER_CHECK(TypeMismatch, type_mismatch, 1) \ |
40 | | - SANITIZER_CHECK(AlignmentAssumption, alignment_assumption, 0) \ |
41 | | - SANITIZER_CHECK(VLABoundNotPositive, vla_bound_not_positive, 0) \ |
42 | | - SANITIZER_CHECK(BoundsSafety, bounds_safety, 0) |
| 17 | + SANITIZER_CHECK(AddOverflow, add_overflow, 0, "Integer addition overflowed") \ |
| 18 | + SANITIZER_CHECK(BuiltinUnreachable, builtin_unreachable, 0, \ |
| 19 | + "_builtin_unreachable(), execution reached an unreachable " \ |
| 20 | + "program point") \ |
| 21 | + SANITIZER_CHECK(CFICheckFail, cfi_check_fail, 0, \ |
| 22 | + "Control flow integrity check failed") \ |
| 23 | + SANITIZER_CHECK(DivremOverflow, divrem_overflow, 0, \ |
| 24 | + "Integer divide or remainder overflowed") \ |
| 25 | + SANITIZER_CHECK(DynamicTypeCacheMiss, dynamic_type_cache_miss, 0, \ |
| 26 | + "Dynamic type cache miss, member call made on an object " \ |
| 27 | + "whose dynamic type differs from the expected type") \ |
| 28 | + SANITIZER_CHECK(FloatCastOverflow, float_cast_overflow, 0, \ |
| 29 | + "Floating-point to integer conversion overflowed") \ |
| 30 | + SANITIZER_CHECK(FunctionTypeMismatch, function_type_mismatch, 0, \ |
| 31 | + "Function called with mismatched signature") \ |
| 32 | + SANITIZER_CHECK(ImplicitConversion, implicit_conversion, 0, \ |
| 33 | + "Implicit integer conversion overflowed or lost data") \ |
| 34 | + SANITIZER_CHECK(InvalidBuiltin, invalid_builtin, 0, \ |
| 35 | + "Invalid use of builtin function") \ |
| 36 | + SANITIZER_CHECK(InvalidObjCCast, invalid_objc_cast, 0, \ |
| 37 | + "Invalid Objective-C cast") \ |
| 38 | + SANITIZER_CHECK(LoadInvalidValue, load_invalid_value, 0, \ |
| 39 | + "Loaded an invalid or uninitialized value for the type") \ |
| 40 | + SANITIZER_CHECK(MissingReturn, missing_return, 0, \ |
| 41 | + "Execution reached the end of a value-returning function " \ |
| 42 | + "without returning a value") \ |
| 43 | + SANITIZER_CHECK(MulOverflow, mul_overflow, 0, \ |
| 44 | + "Integer multiplication overflowed") \ |
| 45 | + SANITIZER_CHECK(NegateOverflow, negate_overflow, 0, \ |
| 46 | + "Integer negation overflowed") \ |
| 47 | + SANITIZER_CHECK( \ |
| 48 | + NullabilityArg, nullability_arg, 0, \ |
| 49 | + "Passing null as an argument which is annotated with _Nonnull") \ |
| 50 | + SANITIZER_CHECK(NullabilityReturn, nullability_return, 1, \ |
| 51 | + "Returning null from a function with a return type " \ |
| 52 | + "annotated with _Nonnull") \ |
| 53 | + SANITIZER_CHECK(NonnullArg, nonnull_arg, 0, \ |
| 54 | + "Passing null pointer as an argument which is declared to " \ |
| 55 | + "never be null") \ |
| 56 | + SANITIZER_CHECK(NonnullReturn, nonnull_return, 1, \ |
| 57 | + "Returning null pointer from a function which is declared " \ |
| 58 | + "to never return null") \ |
| 59 | + SANITIZER_CHECK(OutOfBounds, out_of_bounds, 0, "Array index out of bounds") \ |
| 60 | + SANITIZER_CHECK(PointerOverflow, pointer_overflow, 0, \ |
| 61 | + "Pointer arithmetic overflowed bounds") \ |
| 62 | + SANITIZER_CHECK(ShiftOutOfBounds, shift_out_of_bounds, 0, \ |
| 63 | + "Shift exponent is too large for the type") \ |
| 64 | + SANITIZER_CHECK(SubOverflow, sub_overflow, 0, \ |
| 65 | + "Integer subtraction overflowed") \ |
| 66 | + SANITIZER_CHECK(TypeMismatch, type_mismatch, 1, \ |
| 67 | + "Type mismatch in operation") \ |
| 68 | + SANITIZER_CHECK(AlignmentAssumption, alignment_assumption, 0, \ |
| 69 | + "Alignment assumption violated") \ |
| 70 | + SANITIZER_CHECK( \ |
| 71 | + VLABoundNotPositive, vla_bound_not_positive, 0, \ |
| 72 | + "Variable length array bound evaluates to non-positive value") \ |
| 73 | + SANITIZER_CHECK(BoundsSafety, bounds_safety, 0, \ |
| 74 | + "") // BoundsSafety Msg is empty because it is not considered |
| 75 | + // part of UBSan; therefore, no trap reason is emitted for |
| 76 | + // this case. |
43 | 77 |
|
44 | 78 | enum SanitizerHandler { |
45 | | -#define SANITIZER_CHECK(Enum, Name, Version) Enum, |
| 79 | +#define SANITIZER_CHECK(Enum, Name, Version, Msg) Enum, |
46 | 80 | LIST_SANITIZER_CHECKS |
47 | 81 | #undef SANITIZER_CHECK |
48 | 82 | }; |
|
0 commit comments