From 8cc9818463fc72c08118ae83cd6a1d8c91106d86 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 16 Jan 2017 19:29:32 +0000 Subject: 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index 8517c0e560..002493c6e4 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -1272,7 +1272,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, rb_cref_t *const cref_ 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_func *func, VALUE data, int *stateptr) 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); -- cgit v1.2.3