THRIFT-2182 rb: segfault in regression tests (GC bug in rb_thrift_memory_buffer_write)
Patch: Paul Brannan
diff --git a/lib/rb/ext/struct.c b/lib/rb/ext/struct.c
index 8fbadbe..313da4c 100644
--- a/lib/rb/ext/struct.c
+++ b/lib/rb/ext/struct.c
@@ -607,7 +607,7 @@
if (field_type == specified_type) {
// read the value
VALUE name = rb_hash_aref(field_info, name_sym);
- rb_iv_set(self, "@setfield", ID2SYM(rb_intern(RSTRING_PTR(name))));
+ rb_iv_set(self, "@setfield", rb_str_intern(name));
rb_iv_set(self, "@value", read_anything(protocol, field_type, field_info));
} else {
rb_funcall(protocol, skip_method_id, 1, field_type_value);