Index: third_party/mojo/src/mojo/public/go/bindings/message.go |
diff --git a/third_party/mojo/src/mojo/public/go/bindings/message.go b/third_party/mojo/src/mojo/public/go/bindings/message.go |
index e5c832975a8f217ffa655cc0ba925f90596f2952..8455cd4b1e1323c4a11fc7a9120de09dfde2337d 100644 |
--- a/third_party/mojo/src/mojo/public/go/bindings/message.go |
+++ b/third_party/mojo/src/mojo/public/go/bindings/message.go |
@@ -68,10 +68,11 @@ func (h *MessageHeader) Encode(encoder *Encoder) error { |
} |
func (h *MessageHeader) Decode(decoder *Decoder) error { |
- numFields, err := decoder.StartStruct() |
+ header, err := decoder.StartStruct() |
if err != nil { |
return err |
} |
+ numFields := header.ElementsOrVersion |
if numFields < 2 || numFields > 3 { |
return fmt.Errorf("Invalid message header: it should have 2 or 3 fileds, but has %d", numFields) |
} |