summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/ancdata.c2
-rw-r--r--ext/socket/init.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 3e6431ebbf6..7fe965918d5 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1677,7 +1677,7 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
else {
rb_str_resize(dat_str, ss);
OBJ_TAINT(dat_str);
- RBASIC(dat_str)->klass = rb_cString;
+ rb_obj_reveal(dat_str, rb_cString);
}
ret = rb_ary_new3(3, dat_str,
diff --git a/ext/socket/init.c b/ext/socket/init.c
index a5ffe7bfa5e..6d98a66d6e8 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);
}