bufbuild / protocompile

A parsing/linking engine for protobuf; the guts for a pure Go replacement of protoc.
Apache License 2.0
227 stars 18 forks source link

Fix bug in extension declarations: presence of a declaration implies the range is verified #303

Closed jhump closed 4 months ago

jhump commented 4 months ago

I didn't quite implement this correctly, where "correct" means matching the behavior of protoc. For protoc, the presence of a declaration implies that verification = DECLARATION. https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.cc#L8003-L8023

I previously had implemented it where validation only occurred when verification was explicitly set to DECLARATION. Oops.