summaryrefslogtreecommitdiff
path: root/ext/socket/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/init.c')
-rw-r--r--ext/socket/init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/socket/init.c b/ext/socket/init.c
index a5ffe7b..6d98a66 100644
--- a/ext/socket/init.c
+++ b/ext/socket/init.c
@@ -132,7 +132,7 @@ rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
arg.str = str = rb_tainted_str_new(0, buflen);
klass = RBASIC(str)->klass;
- RBASIC(str)->klass = 0;
+ rb_obj_hide(str);
while (rb_io_check_closed(fptr),
rb_thread_wait_fd(arg.fd),
@@ -145,7 +145,7 @@ rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
}
}
- RBASIC(str)->klass = klass;
+ rb_obj_reveal(str, klass);
if (slen < RSTRING_LEN(str)) {
rb_str_set_len(str, slen);
}