diff --git a/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs b/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs deleted file mode 100644 index 208ce1fcb6..0000000000 --- a/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -namespace Google.Protobuf.Reflection; - -internal sealed partial class FeatureSetDescriptor -{ - // Canonical serialized form of the edition defaults, generated by embed_edition_defaults. - private const string DefaultsBase64 = - "ChMYhAciACoMCAEQAhgCIAMoATACChMY5wciACoMCAIQARgBIAIoATABChMY6AciDAgBEAEYASACKAEwASoAIOYHKOgH"; -} diff --git a/upb/message/message.c b/upb/message/message.c index daeeef1dcf..8503c3584e 100644 --- a/upb/message/message.c +++ b/upb/message/message.c @@ -55,17 +55,19 @@ void _upb_Message_DiscardUnknown_shallow(upb_Message* msg) { bool upb_Message_NextUnknown(const upb_Message* msg, upb_StringView* data, uintptr_t* iter) { - upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg); + const upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg); if (in && *iter == kUpb_Message_UnknownBegin) { - data->size = in->unknown_end - message_overhead; - data->data = (char*)(in + 1); - (*iter)++; - return true; - } else { - data->size = 0; - data->data = NULL; - return false; + size_t len = in->unknown_end - message_overhead; + if (len != 0) { + data->size = len; + data->data = (const char*)(in + 1); + (*iter)++; + return true; + } } + data->size = 0; + data->data = NULL; + return false; } const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len) {