Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
json: fix ordering of integers greater than i64::MAX
Fixes a bug in the ordering of JSON numbers that are greater than the maximum signed 64 bit integer. The previous ordering logic would convert the unsigned integer to signed, which would overflow if the value was larger than `i64::MAX`, leading to an incorrect ordering result. This fixes that by adding in special cases for comparisons between negative signed integers and unsigned integers. The casts from `u64 -> i64` were replaced with casts from `i64 -> u64`, relying on the previous checks to ensure that the `i64` value is not negative.
- Loading branch information