-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add checks for overflow/underflow in time conversion #2722
Comments
I guess the question is if we should either just accept the overflow or clamp it to E.g |
I'll investigate this issue as I need to work on #2707. I'll talk with other binding teams if necessary. |
Core has some optimized functions for checking for overflow/underflow. |
Thanks @kneth! I'll make sure to make use/reference out of them. |
With the expanded resolution of
Date
fields, we store dates as(seconds, nanoseconds)
. Converting to aDate
might result in an overflow whenseconds > INT64_MAX/1000
(and similar for underflow).This is not a problem for Realm files used on Android only, but other bindings might be able to utilize the full range i.e.,
seconds > INT64_MAX/1000
.The text was updated successfully, but these errors were encountered: