ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile

See doc/extension.rdoc for explanation.

[ruby-core:69419] [Feature #11198]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2015-05-30 08:19:37 +00:00
parent c1f355d91f
commit 5e3455597d
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Sat May 30 16:12:35 2015 Eric Wong <e@80x24.org>
* ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile
[ruby-core:69419] [Feature #11198]
Sat May 30 15:59:10 2015 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/tempfile.rb (Tempfile#initialize): initialize @unlinked to fix

View File

@ -1135,7 +1135,7 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
struct msghdr mh;
struct iovec iov;
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
volatile VALUE controls_str = 0;
VALUE controls_str = 0;
VALUE *controls_ptr = NULL;
int family;
#endif
@ -1291,6 +1291,9 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "sendmsg(2) would block");
rb_sys_fail("sendmsg(2)");
}
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
RB_GC_GUARD(controls_str);
#endif
return SSIZET2NUM(ss);
}