-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
writeFloat* and writeDouble* do no longer throw range error when out of bounds #5587
Comments
this commit introduces silent drop behaviour. |
I do not pass noAssert. According to the docs of writeDouble*:
After reading this, i expect it to not silently drop because i did not pass noAssert so it defaults to false. |
cc @trevnorris |
@Ravoltz Setting |
The regression appeared between v5.1.1 and v5.2.0 |
I suspect fcf0e8e |
Confirmed with |
The commit linked by @princejwesley introduces the behavior where, if there would be overflow, we instead copy as much of the value as possible without overflowing. The check to see whether range errors should be thrown should occur above this failsafe logic. I'll put together a PR with this change. |
The check to determine whether `noAssert` was set to true and thus whether RangeErrors should be thrown was happening after the write was truncated to the available size of the buffer. These checks now occur in the correct order. Fixes: #5587 PR-URL: #5605 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
I'l let the code speak for itself.
System 1
System 2
The text was updated successfully, but these errors were encountered: