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

ruby-changes:45274

From: nagachika <ko1@a...>
Date: Tue, 17 Jan 2017 04:29:37 +0900 (JST)
Subject: [ruby-changes:45274] nagachika:r57347 (ruby_2_3): merge revision(s) 57020, 57021: [Backport #13014]

nagachika	2017-01-17 04:29:32 +0900 (Tue, 17 Jan 2017)

  New Revision: 57347

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57347

  Log:
    merge revision(s) 57020,57021: [Backport #13014]
    
    Add clang volatile fixes from FreeBSD and NetBSD.
    
    Use volatile instead of optnone to avoid optimization which causes
    segmentation faults.
    Patch by Dimitry Andric.  [ruby-core:78531] [Bug #13014]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/cont.c
    branches/ruby_2_3/eval.c
    branches/ruby_2_3/eval_error.c
    branches/ruby_2_3/thread.c
    branches/ruby_2_3/version.h
    branches/ruby_2_3/vm_eval.c
    branches/ruby_2_3/vm_trace.c
Index: ruby_2_3/eval.c
===================================================================
--- ruby_2_3/eval.c	(revision 57346)
+++ ruby_2_3/eval.c	(revision 57347)
@@ -804,7 +804,7 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), V https://github.com/ruby/ruby/blob/trunk/ruby_2_3/eval.c#L804
 {
     int state;
     rb_thread_t *th = GET_THREAD();
-    rb_control_frame_t *cfp = th->cfp;
+    rb_control_frame_t *volatile cfp = th->cfp;
     volatile VALUE result = Qfalse;
     volatile VALUE e_info = th->errinfo;
     va_list args;
@@ -870,7 +870,7 @@ rb_protect(VALUE (* proc) (VALUE), VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_3/eval.c#L870
     volatile VALUE result = Qnil;
     volatile int status;
     rb_thread_t *th = GET_THREAD();
-    rb_control_frame_t *cfp = th->cfp;
+    rb_control_frame_t *volatile cfp = th->cfp;
     struct rb_vm_protect_tag protect_tag;
     rb_jmpbuf_t org_jmpbuf;
 
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 57346)
+++ ruby_2_3/version.h	(revision 57347)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.3"
 #define RUBY_RELEASE_DATE "2017-01-17"
-#define RUBY_PATCHLEVEL 231
+#define RUBY_PATCHLEVEL 232
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 1
Index: ruby_2_3/vm_trace.c
===================================================================
--- ruby_2_3/vm_trace.c	(revision 57346)
+++ ruby_2_3/vm_trace.c	(revision 57347)
@@ -389,7 +389,7 @@ rb_suppress_tracing(VALUE (*func)(VALUE) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/vm_trace.c#L389
     volatile int raised;
     volatile int outer_state;
     VALUE result = Qnil;
-    rb_thread_t *th = GET_THREAD();
+    rb_thread_t *volatile th = GET_THREAD();
     int state;
     const int tracing = th->trace_arg ? 1 : 0;
     rb_trace_arg_t dummy_trace_arg;
Index: ruby_2_3/cont.c
===================================================================
--- ruby_2_3/cont.c	(revision 57346)
+++ ruby_2_3/cont.c	(revision 57347)
@@ -167,7 +167,7 @@ static VALUE rb_eFiberError; https://github.com/ruby/ruby/blob/trunk/ruby_2_3/cont.c#L167
     if (!(ptr)) rb_raise(rb_eFiberError, "uninitialized fiber"); \
 } while (0)
 
-NOINLINE(static VALUE cont_capture(volatile int *stat));
+NOINLINE(static VALUE cont_capture(volatile int *volatile stat));
 
 #define THREAD_MUST_BE_RUNNING(th) do { \
 	if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread");	\
@@ -475,13 +475,9 @@ cont_new(VALUE klass) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/cont.c#L475
 }
 
 static VALUE
-cont_capture(volatile int *stat)
-#if defined(__clang__) && \
-    __clang_major__ == 3 && __clang_minor__ == 8 && __clang_patch__ == 0
-__attribute__ ((optnone))
-#endif
+cont_capture(volatile int *volatile stat)
 {
-    rb_context_t *cont;
+    rb_context_t *volatile cont;
     rb_thread_t *th = GET_THREAD();
     volatile VALUE contval;
 
Index: ruby_2_3/eval_error.c
===================================================================
--- ruby_2_3/eval_error.c	(revision 57346)
+++ ruby_2_3/eval_error.c	(revision 57347)
@@ -65,7 +65,7 @@ error_print(void) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/eval_error.c#L65
     volatile VALUE errat = Qundef;
     rb_thread_t *th = GET_THREAD();
     VALUE errinfo = th->errinfo;
-    int raised_flag = th->raised_flag;
+    volatile int raised_flag = th->raised_flag;
     volatile VALUE eclass = Qundef, e = Qundef;
     const char *volatile einfo;
     volatile long elen;
Index: ruby_2_3/thread.c
===================================================================
--- ruby_2_3/thread.c	(revision 57346)
+++ ruby_2_3/thread.c	(revision 57347)
@@ -466,8 +466,8 @@ rb_threadptr_unlock_all_locking_mutexes( https://github.com/ruby/ruby/blob/trunk/ruby_2_3/thread.c#L466
 void
 rb_thread_terminate_all(void)
 {
-    rb_thread_t *th = GET_THREAD(); /* main thread */
-    rb_vm_t *vm = th->vm;
+    rb_thread_t *volatile th = GET_THREAD(); /* main thread */
+    rb_vm_t *volatile vm = th->vm;
     volatile int sleeping = 0;
 
     if (vm->main_thread != th) {
Index: ruby_2_3/vm_eval.c
===================================================================
--- ruby_2_3/vm_eval.c	(revision 57346)
+++ ruby_2_3/vm_eval.c	(revision 57347)
@@ -1272,7 +1272,7 @@ eval_string_with_cref(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_3/vm_eval.c#L1272
     int state;
     VALUE result = Qundef;
     VALUE envval;
-    rb_thread_t *th = GET_THREAD();
+    rb_thread_t *volatile th = GET_THREAD();
     rb_env_t *env = NULL;
     rb_block_t block, *base_block;
     volatile int parse_in_eval;
@@ -2007,7 +2007,7 @@ rb_catch_protect(VALUE t, rb_block_call_ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/vm_eval.c#L2007
     int state;
     volatile VALUE val = Qnil;		/* OK */
     rb_thread_t *th = GET_THREAD();
-    rb_control_frame_t *saved_cfp = th->cfp;
+    rb_control_frame_t *volatile saved_cfp = th->cfp;
     volatile VALUE tag = t;
 
     TH_PUSH_TAG(th);

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r57020-57021


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

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