upb: Add upb_Message_GetExtensionMutableArray
PiperOrigin-RevId: 698010022
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 208ce1f..0000000
--- 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/accessors.h b/upb/message/accessors.h
index 7dfb2f5..0387fa0 100644
--- a/upb/message/accessors.h
+++ b/upb/message/accessors.h
@@ -206,6 +206,9 @@
UPB_API_INLINE const upb_Array* upb_Message_GetExtensionArray(
const upb_Message* msg, const upb_MiniTableExtension* f);
+UPB_API_INLINE upb_Array* upb_Message_GetExtensionMutableArray(
+ upb_Message* msg, const upb_MiniTableExtension* f);
+
// Extension Setters ///////////////////////////////////////////////////////////
UPB_API_INLINE bool upb_Message_SetExtension(upb_Message* msg,
diff --git a/upb/message/internal/accessors.h b/upb/message/internal/accessors.h
index 5a89323..360ed61 100644
--- a/upb/message/internal/accessors.h
+++ b/upb/message/internal/accessors.h
@@ -1030,6 +1030,19 @@
return ret;
}
+UPB_API_INLINE upb_Array* upb_Message_GetExtensionMutableArray(
+ struct upb_Message* msg, const upb_MiniTableExtension* e) {
+ UPB_ASSERT(!upb_Message_IsFrozen(msg));
+ UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(&e->UPB_PRIVATE(field)) ==
+ kUpb_FieldRep_NativePointer);
+ UPB_ASSUME(upb_MiniTableField_IsArray(&e->UPB_PRIVATE(field)));
+ UPB_ASSUME(e->UPB_PRIVATE(field).presence == 0);
+ upb_Array* ret;
+ upb_Array* default_val = NULL;
+ _upb_Message_GetExtensionField(msg, e, &default_val, &ret);
+ return ret;
+}
+
#ifdef __cplusplus
} /* extern "C" */
#endif