From feea5d6fb45ce7485c411a1234107534a4b5bd76 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 14 Oct 2012 23:53:37 +0000 Subject: [PATCH] Provide a slightly more helpful diagnostic if -fcatch-undefined-behavior finds a problem with __int128 arithmetic but the runtime was not built with __int128 support. llvm-svn: 165913 --- compiler-rt/lib/ubsan/ubsan_value.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler-rt/lib/ubsan/ubsan_value.cc b/compiler-rt/lib/ubsan/ubsan_value.cc index 3d6a735..f17c589 100644 --- a/compiler-rt/lib/ubsan/ubsan_value.cc +++ b/compiler-rt/lib/ubsan/ubsan_value.cc @@ -30,6 +30,9 @@ SIntMax Value::getSIntValue() const { #if HAVE_INT128_T if (getType().getIntegerBitWidth() == 128) return *reinterpret_cast(Val); +#else + if (getType().getIntegerBitWidth() == 128) + UNREACHABLE("libclang_rt.ubsan was built without __int128 support"); #endif UNREACHABLE("unexpected bit width"); } @@ -43,6 +46,9 @@ UIntMax Value::getUIntValue() const { #if HAVE_INT128_T if (getType().getIntegerBitWidth() == 128) return *reinterpret_cast(Val); +#else + if (getType().getIntegerBitWidth() == 128) + UNREACHABLE("libclang_rt.ubsan was built without __int128 support"); #endif UNREACHABLE("unexpected bit width"); } -- 2.7.4