aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-07 23:27:51 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-07 23:27:51 +0000
commit8e385ad70b3571dbdce5ea48524b358d9630238a (patch)
treede3ac74b5f70b9251972088215a294d7e6fb3ba8 /cont.c
parentc2ba4b0e5aefd059e72afe8e1d74c0b6b0f8ce0e (diff)
downloadruby-8e385ad70b3571dbdce5ea48524b358d9630238a.tar.gz
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/cont.c b/cont.c
index 2d8b98dbf4..09127733c3 100644
--- a/cont.c
+++ b/cont.c
@@ -161,7 +161,7 @@ static VALUE rb_eFiberError;
if (!(ptr)) rb_raise(rb_eFiberError, "uninitialized fiber"); \
} while (0)
-NOINLINE(static VALUE cont_capture(volatile int *stat));
+NOINLINE(static VALUE cont_capture(int *volatile stat));
#define THREAD_MUST_BE_RUNNING(th) do { \
if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread"); \
@@ -470,13 +470,9 @@ cont_new(VALUE klass)
}
static VALUE
-cont_capture(volatile int *stat)
-#if defined(__clang__) && \
- __clang_major__ == 3 && __clang_minor__ == 8 && __clang_patch__ == 0
-__attribute__ ((optnone))
-#endif
+cont_capture(int *volatile stat)
{
- rb_context_t *cont;
+ rb_context_t *volatile cont;
rb_thread_t *th = GET_THREAD();
volatile VALUE contval;