File tree Expand file tree Collapse file tree 2 files changed +2
-0
lines changed
include/rapidjson/internal Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ struct DiyFp {
99
99
}
100
100
101
101
DiyFp Normalize () const {
102
+ RAPIDJSON_ASSERT (f != 0 ); // https://stackoverflow.com/a/26809183/291737
102
103
#if defined(_MSC_VER) && defined(_M_AMD64)
103
104
unsigned long index;
104
105
_BitScanReverse64 (&index, f);
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ static void TestParseDouble() {
207
207
208
208
TEST_DOUBLE (fullPrecision, " 0.0" , 0.0 );
209
209
TEST_DOUBLE (fullPrecision, " -0.0" , -0.0 ); // For checking issue #289
210
+ TEST_DOUBLE (fullPrecision, " 0e100" , 0.0 ); // Normalize() must not invoke __builtin_clzll(0)
210
211
TEST_DOUBLE (fullPrecision, " 1.0" , 1.0 );
211
212
TEST_DOUBLE (fullPrecision, " -1.0" , -1.0 );
212
213
TEST_DOUBLE (fullPrecision, " 1.5" , 1.5 );
You can’t perform that action at this time.
0 commit comments