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

difference to protoc: tag number validation overly strict #275

Closed
stapelberg opened this issue Sep 5, 2019 · 0 comments · Fixed by #316
Closed

difference to protoc: tag number validation overly strict #275

stapelberg opened this issue Sep 5, 2019 · 0 comments · Fixed by #316

Comments

@stapelberg
Copy link
Contributor

The following .proto file fails parsing with protoreflect, but not with protoc:

syntax = "proto2";

message Foo {
  extend proto2.bridge.MessageSet {
    optional string message_set_extension = 999999999;
  }
}

I’m getting this error message from protoreflect:

msgsetrepro.proto:5:45: tag number 999999999 is higher than max allowed tag number (536870911)

I can’t find corresponding tag validation code in protoc itself, but this code seems related:

https://github.com/protocolbuffers/protobuf/blob/7f520092d9050d96fb4b707ad11a51701af4ce49/src/google/protobuf/compiler/parser.cc#L806

To me, it looks like for message sets, the maximum tag number is kint32max, not FieldDescriptor::kMaxNumber.

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

Successfully merging a pull request may close this issue.

1 participant