diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-13 07:00:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-13 07:00:14 +0000 |
commit | f2d77d03b75733139c9f0896162bbc7a6fc38385 (patch) | |
tree | 15565e23e346bb09944af09885fe1bb8773183b3 /lib/ubsan/ubsan_handlers.h | |
parent | 6afa1b0406f5cce7256d4f8717bfe394a16999b5 (diff) |
ubsan: Add -fsanitize=bool and -fsanitize=enum, which check for loads of
bit-patterns which are not valid values for enumerated or boolean types.
These checks are the ubsan analogue of !range metadata.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@170107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ubsan/ubsan_handlers.h')
-rw-r--r-- | lib/ubsan/ubsan_handlers.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ubsan/ubsan_handlers.h b/lib/ubsan/ubsan_handlers.h index 5709fcf67..b50f57f25 100644 --- a/lib/ubsan/ubsan_handlers.h +++ b/lib/ubsan/ubsan_handlers.h @@ -91,6 +91,14 @@ struct FloatCastOverflowData { /// \brief Handle overflow in a conversion to or from a floating-point type. RECOVERABLE(float_cast_overflow, FloatCastOverflowData *Data, ValueHandle From) +struct InvalidValueData { + // FIXME: SourceLocation Loc; + const TypeDescriptor &Type; +}; + +/// \brief Handle a load of an invalid value for the type. +RECOVERABLE(load_invalid_value, InvalidValueData *Data, ValueHandle Val) + } #endif // UBSAN_HANDLERS_H |