internal/impl: fix messageset validation bug

The validator was not ensuring the the MessageInfo for messageset
items was initialized. Fixed.

One or more of the existing messageset tests fail when run in isolation
due to this bug, but running all of them in sequence passes due to an
earlier test initializing the MessageInfo first.

Change-Id: Ifa7bd525c6d1cef9d1bed7bf761b0380907e35ee
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221023
Reviewed-by: Joe Tsai <joetsai@google.com>
This commit is contained in:
Damien Neil 2020-02-26 08:35:54 -08:00
parent e0daf31d84
commit 5698f90d86

View File

@ -518,6 +518,9 @@ State:
return out, ValidationUnknown
default:
xvi := getExtensionFieldInfo(xt).validation
if xvi.mi != nil {
xvi.mi.init()
}
states = append(states, validationState{
typ: xvi.typ,
mi: xvi.mi,