You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I submitted a PR recently to convert the problem from a panic to a runtime error, but I was under the mistaken impression that the protobuf data we were being given was occasionally broken. Instead, the Python and C++ canonical implementations, along with the docs, indicate that the appropriate order of operations is something like the following:
// potential_varint: []const u8 -- valid if at most 10 bytes have 1 as the MSB
const decoded_x: u64 = try decode_varint(potential_varint);
const interpreted_x: i32 = @intCast(@as(i64, @bitCast(decoded_x)));
As opposed to the current logic, which either truncates the extra 4 bytes of decoded data, or fails when any of those extra 4 bytes are 0.
This is likely a (small) problem throughout the codebase, not isolated to enums or any one feature.
The text was updated successfully, but these errors were encountered:
I submitted a PR recently to convert the problem from a panic to a runtime error, but I was under the mistaken impression that the protobuf data we were being given was occasionally broken. Instead, the Python and C++ canonical implementations, along with the docs, indicate that the appropriate order of operations is something like the following:
As opposed to the current logic, which either truncates the extra 4 bytes of decoded data, or fails when any of those extra 4 bytes are 0.
This is likely a (small) problem throughout the codebase, not isolated to enums or any one feature.
The text was updated successfully, but these errors were encountered: