diff options
author | Eli Fidler <efidler@topologyinc.com> | 2016-05-31 19:39:09 +0300 |
---|---|---|
committer | Eli Fidler <efidler@topologyinc.com> | 2016-06-14 17:01:41 +0300 |
commit | 9dcf51c3a1c8c08411c706b3936e6fba5d25e69d (patch) | |
tree | ee5ded80f22e501fa2f5af9f8ae731cb76383a89 /include/rapidjson/internal | |
parent | df9b45a6568ee8002ad64cabcc5124192f38d749 (diff) |
avoid shift out-of-range error
UBSAN gave during Reader.ParseNumber_FullPrecisionDouble test:
include/rapidjson/internal/strtod.h:149:11: runtime error: shift exponent 46 is too large for 32-bit type 'int'
Diffstat (limited to 'include/rapidjson/internal')
-rw-r--r-- | include/rapidjson/internal/strtod.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/rapidjson/internal/strtod.h b/include/rapidjson/internal/strtod.h index fd4b01e8..289c413b 100644 --- a/include/rapidjson/internal/strtod.h +++ b/include/rapidjson/internal/strtod.h @@ -142,7 +142,7 @@ inline bool StrtodDiyFp(const char* decimals, size_t length, size_t decimalPosit size_t remaining = length - i; const unsigned kUlpShift = 3; const unsigned kUlp = 1 << kUlpShift; - int error = (remaining == 0) ? 0 : kUlp / 2; + int64_t error = (remaining == 0) ? 0 : kUlp / 2; DiyFp v(significand, 0); v = v.Normalize(); |