kpumuk commented on code in PR #3691:
URL: https://github.com/apache/thrift/pull/3691#discussion_r3704380569


##########
lib/rb/ext/struct.c:
##########
@@ -771,17 +820,26 @@ static VALUE rb_thrift_union_write(VALUE self, VALUE 
protocol) {
   return Qnil;
 }
 
+// cppcheck-suppress constParameterCallback
+static VALUE rb_thrift_union_write(int argc, VALUE *argv, VALUE self) {
+  VALUE protocol;
+  int remaining_depth = parse_recursive_args(argc, argv, &protocol);
+  return rb_thrift_union_write_recursive(self, protocol, remaining_depth);
+}
+
 void Init_struct(void) {
   VALUE struct_module = rb_const_get(thrift_module, rb_intern("Struct"));
 
-  rb_define_method(struct_module, "write", rb_thrift_struct_write, 1);
-  rb_define_method(struct_module, "read", rb_thrift_struct_read, 1);
+  recursion_limit = FIX2INT(rb_const_get(thrift_module, 
rb_intern("DEFAULT_RECURSION_DEPTH")));
+
+  rb_define_method(struct_module, "write", rb_thrift_struct_write, -1);
+  rb_define_method(struct_module, "read", rb_thrift_struct_read, -1);

Review Comment:
   Native extension cannot be loaded before thrift, it fails on fetching 
module. You are drunk, Copilot



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to