[前][次][番号順一覧][スレッド一覧]

ruby-changes:32636

From: nobu <ko1@a...>
Date: Mon, 27 Jan 2014 22:16:29 +0900 (JST)
Subject: [ruby-changes:32636] nobu:r44715 (trunk): thread_pthread.c: cast to size_t

nobu	2014-01-27 22:16:25 +0900 (Mon, 27 Jan 2014)

  New Revision: 44715

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44715

  Log:
    thread_pthread.c: cast to size_t
    
    * thread_pthread.c (ruby_stack_overflowed_p): range of rlim_cur
      may be larger than size_t.  [ruby-core:60113] [Bug #9454]

  Modified files:
    trunk/thread_pthread.c
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 44714)
+++ thread_pthread.c	(revision 44715)
@@ -1566,7 +1566,7 @@ ruby_stack_overflowed_p(const rb_thread_ https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1566
 	if (pthread_equal(th->thread_id, native_main_thread.id)) {
 	    struct rlimit rlim;
 	    if (getrlimit(RLIMIT_STACK, &rlim) == 0 && rlim.rlim_cur > size) {
-		size = rlim.rlim_cur;
+		size = (size_t)rlim.rlim_cur;
 	    }
 	}
 #endif

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]