From 5698f90d86145f1cc6880ce317f9c1f3eb10e52c Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Wed, 26 Feb 2020 08:35:54 -0800 Subject: [PATCH] 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 --- internal/impl/validate.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/impl/validate.go b/internal/impl/validate.go index 449331be..c0148ab5 100644 --- a/internal/impl/validate.go +++ b/internal/impl/validate.go @@ -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,