[Lldb-commits] [lldb] r323081 - Fix unrepresentable float value in ScalarTest

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 22 00:11:29 PST 2018


Author: teemperor
Date: Mon Jan 22 00:11:29 2018
New Revision: 323081

URL: http://llvm.org/viewvc/llvm-project?rev=323081&view=rev
Log:
Fix unrepresentable float value in ScalarTest

Summary: float can't represent the given value in the literal, so we get this UB error: `runtime error: 1.23457e+48 is outside the range of representable values of type 'float'`. The test seems to not rely on this specific value, so let's just choose a smaller one that can be represented.

Reviewers: uweigand

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D42338

Modified:
    lldb/trunk/unittests/Core/ScalarTest.cpp

Modified: lldb/trunk/unittests/Core/ScalarTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/ScalarTest.cpp?rev=323081&r1=323080&r2=323081&view=diff
==============================================================================
--- lldb/trunk/unittests/Core/ScalarTest.cpp (original)
+++ lldb/trunk/unittests/Core/ScalarTest.cpp Mon Jan 22 00:11:29 2018
@@ -31,7 +31,7 @@ TEST(ScalarTest, RightShiftOperator) {
 TEST(ScalarTest, GetBytes) {
   int a = 0x01020304;
   long long b = 0x0102030405060708LL;
-  float c = 1234567.89e42;
+  float c = 1234567.89e32;
   double d = 1234567.89e42;
   char e[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
   char f[32] = {1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,




More information about the lldb-commits mailing list