summaryrefslogtreecommitdiff
path: root/lib/ubsan/ubsan_handlers.cc
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-10-12 22:57:15 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-10-12 22:57:15 +0000
commit58561700a4abad310911a24a867da49a14fae91e (patch)
tree918824756560a5ac1151f815bf03c127964e74fe /lib/ubsan/ubsan_handlers.cc
parentb04caf1385a4279a7b95d41c3ccefc61842c3633 (diff)
-fcatch-undefined-behavior: Runtime library support for trapping conversions to or
from a floating-point type where the source value is not in the range of representable values of the destination type. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@165844 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ubsan/ubsan_handlers.cc')
-rw-r--r--lib/ubsan/ubsan_handlers.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ubsan/ubsan_handlers.cc b/lib/ubsan/ubsan_handlers.cc
index fa3c1e0fc..2cb12c459 100644
--- a/lib/ubsan/ubsan_handlers.cc
+++ b/lib/ubsan/ubsan_handlers.cc
@@ -134,3 +134,11 @@ void __ubsan::__ubsan_handle_vla_bound_not_positive(VLABoundData *Data,
<< Value(Data->Type, Bound);
Die();
}
+
+void __ubsan::__ubsan_handle_float_cast_overflow(FloatCastOverflowData *Data,
+ ValueHandle From) {
+ Diag(SourceLocation(), "value %0 is outside the range of representable "
+ "values of type %2")
+ << Value(Data->FromType, From) << Data->FromType << Data->ToType;
+ Die();
+}