-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
No exception raised for Out Of Range input of numbers #647
Comments
The first number is parsed as double and the second as uint64_t. Calling get does not check for overflows - it is just like writing |
Remark: an exception is thrown by the parser if the given number does not fit neither the integer types nor the floating-point type. |
Did this answer your question? |
In fact, Xcode's undefined behavior sanitizer detects the first issue:
However, this is not inside the library, but in the requested conversion from |
Hello,
if one has values that are beyond the range of the target type no exception is raised.
e.g. this code with a value of UINT64_MAX+1 and 10000 for the target of a signed char outputs 0 and 16 respectively.
Both cases should throw an exception.
Best regards.
The text was updated successfully, but these errors were encountered: