Skip to content
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

ObjC messages return invalid enum values returned for unset fields #1453

Closed
jonwallg opened this issue Apr 26, 2016 · 1 comment
Closed

ObjC messages return invalid enum values returned for unset fields #1453

jonwallg opened this issue Apr 26, 2016 · 1 comment
Assignees

Comments

@jonwallg
Copy link
Contributor

Objective C generated code can return 0 instead of a valid enum value for unset fields. This appears to happen only when no fields specify a default.

test case: 52219f8

@jonwallg
Copy link
Contributor Author

@thomasvl

@jonwallg jonwallg reopened this Apr 26, 2016
@thomasvl thomasvl self-assigned this Apr 26, 2016
thomasvl added a commit to thomasvl/protobuf that referenced this issue Apr 26, 2016
proto2 syntax allows the first enum to have a non zero value. This means any
field using that default has a non zero default without having an explicit
default being set. So when deciding what runtime info is needed, don't rely
on an explicit default, always check that the values aren't zero.

Fixes protocolbuffers#1453
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants