-
Notifications
You must be signed in to change notification settings - Fork 262
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 big endian handling of enums #435
Conversation
Previously using an enum for a field on big-endian process such as the s390x would fail to decode properly. We need to munge it in the correct byte order before decoding it.
Hmm, the
Still, it previously failed with this?
|
I think the decode path is fine, but I think there is an encoding problem with the Good
Bad
Comparison: Good
Bad
|
Good find in the decoder! |
I'll mark this pull request as ready since I've confirmed there is a separate problem with packed enums. |
Eh, this actually could still be a decode problem. I'm not seeing the right bits when the encode starts. |
Perhaps |
Thanks! That did it indeed. |
7cd7dc6
to
8faf897
Compare
This avoids an additional type check when decoding packed enums.
8faf897
to
ba83e13
Compare
Thanks! btw, how did you get Bazel working on s390x? |
@haberman This workaround helped me sidestep the compiler warnings: bazelbuild/bazel#13597 (comment) |
Previously using an enum for a field on big-endian process such as the
s390x would fail to decode properly. We need to munge it in the correct
byte order before decoding it.