Fix segmentation fault in python upb when instantiating field via repeated field assignment
PiperOrigin-RevId: 451406772
diff --git a/python/repeated.c b/python/repeated.c
index bafee23..1c2378f 100644
--- a/python/repeated.c
+++ b/python/repeated.c
@@ -439,7 +439,7 @@
PyObject* value) {
PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
- upb_Array* arr = PyUpb_RepeatedContainer_GetIfReified(self);
+ upb_Array* arr = PyUpb_RepeatedContainer_EnsureReified(_self);
Py_ssize_t size = arr ? upb_Array_Size(arr) : 0;
Py_ssize_t idx, count, step;
if (!IndexToRange(key, size, &idx, &count, &step)) return -1;