From c0053d0d78d5040fb24f148245f6d4027003b558 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 20 Jul 2022 11:08:30 +0200 Subject: [PATCH] Ruby: use a valid instance variable name for `descriptor` Setting an instance variable without an `@` prefix makes it unnacessible from the Ruby side, which prevent introspection by various tools. I see no reason to prevent this. --- ruby/ext/google/protobuf_c/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/ext/google/protobuf_c/message.c b/ruby/ext/google/protobuf_c/message.c index 6b8bbaa3c5e54..e430b7949062c 100644 --- a/ruby/ext/google/protobuf_c/message.c +++ b/ruby/ext/google/protobuf_c/message.c @@ -1398,5 +1398,5 @@ void Message_register(VALUE protobuf) { // Ruby-interned string: "descriptor". We use this identifier to store an // instance variable on message classes we create in order to link them back // to their descriptors. - descriptor_instancevar_interned = rb_intern("descriptor"); + descriptor_instancevar_interned = rb_intern("@descriptor"); }