[PATCH] D11793: [compiler-rt] Add SourceLocations for float_cast_overflow data.

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 17:13:44 PDT 2015


samsonov added inline comments.

================
Comment at: lib/ubsan/ubsan_handlers.h:101
@@ -100,1 +100,3 @@
+// Keeping this around for binary compatibility with (sanitized) programs
+// compiled with older clangs.
 struct FloatCastOverflowData {
----------------
with older compilers.

================
Comment at: lib/ubsan/ubsan_handlers.h:114
@@ -106,3 +113,3 @@
 /// \brief Handle overflow in a conversion to or from a floating-point type.
 RECOVERABLE(float_cast_overflow, FloatCastOverflowData *Data, ValueHandle From)
 
----------------
just use void* Data (or u8* Data) here, and reinterpret_cast it in the function? That would help in `looksLikeFloatCastOverflowDataV1` 

================
Comment at: test/ubsan/TestCases/Float/cast-overflow.cpp:89
@@ -88,3 +88,3 @@
     // successfully round-trip, depending on the rounding mode.
-    // CHECK-0: runtime error: value 2.14748{{.*}} is outside the range of representable values of type 'int'
+    // CHECK-0: {{.*}}cast-overflow.cpp:90:27: runtime error: value 2.14748{{.*}} is outside the range of representable values of type 'int'
     static int test_int = MaxFloatRepresentableAsInt + 0x80;
----------------
use `[[@LINE+1]]` here and below to reference line number.


http://reviews.llvm.org/D11793





More information about the llvm-commits mailing list