Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
c511ce30
Unverified
Commit
c511ce30
authored
Jun 18, 2018
by
Milo Yip
Committed by
GitHub
Jun 18, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1250 from StilesCrisis/issue-1249-test
Unit Test: Parsing "0e100" in full precision mode causes UB
parents
6cc3910a
cad38057
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
0 deletions
+2
-0
diyfp.h
include/rapidjson/internal/diyfp.h
+1
-0
readertest.cpp
test/unittest/readertest.cpp
+1
-0
No files found.
include/rapidjson/internal/diyfp.h
View file @
c511ce30
...
@@ -100,6 +100,7 @@ struct DiyFp {
...
@@ -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
);
...
...
test/unittest/readertest.cpp
View file @
c511ce30
...
@@ -207,6 +207,7 @@ static void TestParseDouble() {
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment