diff --git a/ruby/ext/google/protobuf_c/defs.c b/ruby/ext/google/protobuf_c/defs.c index 5ef73d5ac9..7fd834acf6 100644 --- a/ruby/ext/google/protobuf_c/defs.c +++ b/ruby/ext/google/protobuf_c/defs.c @@ -1510,7 +1510,7 @@ static VALUE MethodDescriptor_initialize(VALUE _self, VALUE cookie, } RB_OBJ_WRITE(_self, &self->descriptor_pool, descriptor_pool); - self->methoddef = (const upb_ServiceDef*)NUM2ULL(ptr); + self->methoddef = (const upb_MethodDef*)NUM2ULL(ptr); return Qnil; }