-
Notifications
You must be signed in to change notification settings - Fork 43
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
adds changes for correctly setting stream position when error occurs while reading binary int64 #244
Conversation
…while reading binary int64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/test_ion_binary.cpp
Outdated
TEST(IonBinaryReader, ReaderNegativeThresholdForInt64) { | ||
test_ion_binary_reader_threshold_for_int64((BYTE *)"\xE0\x01\x00\xEA\x38\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", 13, "-18446744073709551615"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor, but I think variants of the test with 2 ** 63
is interesting '\x80\x00\x00\x00\x00\x00\x00\x00'
should fail for positive int, but not negative int (since -2 ** 63
fits as two's complement representation 0x8000000000000000
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment around testing, but otherwise this looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 it!
See amazon-ion/ion-c#244 for the fix around setting the binary reader's stream position back to the start of value when an error occurs in reading int64 value. Fixes #218
Description of changes:
This PR works on setting stream position correctly when error occurs in reading binary int64 value.
Changes:
Test:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.