Merge pull request #1250 from StilesCrisis/issue-1249-test
Unit Test: Parsing "0e100" in full precision mode causes UB
This commit is contained in:
commit
c511ce303f
@ -100,6 +100,7 @@ struct DiyFp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DiyFp Normalize() const {
|
DiyFp Normalize() const {
|
||||||
|
RAPIDJSON_ASSERT(f != 0); // https://stackoverflow.com/a/26809183/291737
|
||||||
#if defined(_MSC_VER) && defined(_M_AMD64)
|
#if defined(_MSC_VER) && defined(_M_AMD64)
|
||||||
unsigned long index;
|
unsigned long index;
|
||||||
_BitScanReverse64(&index, f);
|
_BitScanReverse64(&index, f);
|
||||||
|
@ -207,6 +207,7 @@ static void TestParseDouble() {
|
|||||||
|
|
||||||
TEST_DOUBLE(fullPrecision, "0.0", 0.0);
|
TEST_DOUBLE(fullPrecision, "0.0", 0.0);
|
||||||
TEST_DOUBLE(fullPrecision, "-0.0", -0.0); // For checking issue #289
|
TEST_DOUBLE(fullPrecision, "-0.0", -0.0); // For checking issue #289
|
||||||
|
TEST_DOUBLE(fullPrecision, "0e100", 0.0); // For checking issue #1249
|
||||||
TEST_DOUBLE(fullPrecision, "1.0", 1.0);
|
TEST_DOUBLE(fullPrecision, "1.0", 1.0);
|
||||||
TEST_DOUBLE(fullPrecision, "-1.0", -1.0);
|
TEST_DOUBLE(fullPrecision, "-1.0", -1.0);
|
||||||
TEST_DOUBLE(fullPrecision, "1.5", 1.5);
|
TEST_DOUBLE(fullPrecision, "1.5", 1.5);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user