[protobuf] Fix invalid function call reported by ubsan
contrib/libs/protobuf/python/google/protobuf/pyext/message.cc:1406:3: runtime error: call to function google::protobuf::python::extension_dict::dealloc(google::protobuf::python::ExtensionDict*) through pointer to incorrect function type 'void (*)(_object *)'
@@ -239,7 +239,8 @@ ExtensionDict* NewExtensionDict(CMessage *parent) {
return self;
}
-void dealloc(ExtensionDict* self) {
+void dealloc(PyObject* object) {
+ ExtensionDict* self = reinterpret_cast<ExtensionDict*>(object);
Py_CLEAR(self->values);
self->owner.reset();
Py_TYPE(self)->tp_free(reinterpret_cast<PyObject*>(self));
