-
Notifications
You must be signed in to change notification settings - Fork 915
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
Fix 64bit shift bug in avro reader #13276
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,9 @@ template <> | |
uint64_t container::get_encoded() | ||
{ | ||
uint64_t val = 0; | ||
for (uint64_t len = 0; len < 64; len += 7) { | ||
auto const byte = get_raw<uint8_t>(); | ||
for (auto len = 0; len < 64; len += 7) { | ||
// 64-bit int since shift left is upto 64. | ||
uint64_t const byte = get_raw<uint8_t>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From some Godbolt experiments, it turns out that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To test, we would have to have an encoded int larger than uint32::max in the Avro file (and the int might have to be in the metadata??). |
||
val |= (byte & 0x7f) << len; | ||
if (byte < 0x80) break; | ||
} | ||
|
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.
another varint decode :)