FreeBSD Bugzilla – Attachment 165370 Details for
Bug 206110
lang/ruby22: fix setjmp clobbered variables (using clang 3.8.0 and optimizing for 'high' CPUs)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Mark several variables volatile so they won't have undefined state after setjmp()
lang__ruby22-fix-setjmp-clobbers-1.diff (text/plain), 6.17 KB, created by
Dimitry Andric
on 2016-01-10 18:38:20 UTC
(
hide
)
Description:
Mark several variables volatile so they won't have undefined state after setjmp()
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2016-01-10 18:38:20 UTC
Size:
6.17 KB
patch
obsolete
>Index: lang/ruby22/files/patch-eval.c >=================================================================== >--- lang/ruby22/files/patch-eval.c (nonexistent) >+++ lang/ruby22/files/patch-eval.c (working copy) >@@ -0,0 +1,20 @@ >+--- eval.c.orig 2014-12-09 02:16:27.000000000 +0100 >++++ eval.c 2016-01-10 19:10:59.326340000 +0100 >+@@ -797,7 +797,7 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), V >+ { >+ 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; >+@@ -863,7 +863,7 @@ rb_protect(VALUE (* proc) (VALUE), VALUE >+ 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; >+ > >Property changes on: lang/ruby22/files/patch-eval.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: lang/ruby22/files/patch-eval_error.c >=================================================================== >--- lang/ruby22/files/patch-eval_error.c (nonexistent) >+++ lang/ruby22/files/patch-eval_error.c (working copy) >@@ -0,0 +1,15 @@ >+--- eval_error.c.orig 2015-01-17 08:47:29.000000000 +0100 >++++ eval_error.c 2016-01-10 19:11:10.416384000 +0100 >+@@ -80,9 +80,9 @@ static void >+ error_print(void) >+ { >+ volatile VALUE errat = Qundef; >+- rb_thread_t *th = GET_THREAD(); >+- VALUE errinfo = th->errinfo; >+- int raised_flag = th->raised_flag; >++ rb_thread_t *volatile th = GET_THREAD(); >++ volatile VALUE errinfo = th->errinfo; >++ volatile int raised_flag = th->raised_flag; >+ volatile VALUE eclass = Qundef, e = Qundef; >+ const char *volatile einfo; >+ volatile long elen; > >Property changes on: lang/ruby22/files/patch-eval_error.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: lang/ruby22/files/patch-thread.c >=================================================================== >--- lang/ruby22/files/patch-thread.c (nonexistent) >+++ lang/ruby22/files/patch-thread.c (working copy) >@@ -0,0 +1,13 @@ >+--- thread.c.orig 2015-02-20 14:53:23.000000000 +0100 >++++ thread.c 2016-01-10 19:11:32.423524000 +0100 >+@@ -462,8 +462,8 @@ rb_threadptr_unlock_all_locking_mutexes( >+ 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; >+ >+ if (vm->main_thread != th) { >+ rb_bug("rb_thread_terminate_all: called by child thread (%p, %p)", > >Property changes on: lang/ruby22/files/patch-thread.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: lang/ruby22/files/patch-vm_eval.c >=================================================================== >--- lang/ruby22/files/patch-vm_eval.c (nonexistent) >+++ lang/ruby22/files/patch-vm_eval.c (working copy) >@@ -0,0 +1,31 @@ >+--- vm_eval.c.orig 2015-11-29 10:01:12.000000000 +0100 >++++ vm_eval.c 2016-01-10 19:11:40.066355000 +0100 >+@@ -1111,7 +1111,7 @@ rb_iterate(VALUE (* it_proc) (VALUE), VA >+ int state; >+ volatile VALUE retval = Qnil; >+ NODE *node = NEW_IFUNC(bl_proc, data2); >+- rb_thread_t *th = GET_THREAD(); >++ rb_thread_t *volatile th = GET_THREAD(); >+ rb_control_frame_t *volatile cfp = th->cfp; >+ >+ node->nd_aid = rb_frame_this_func(); >+@@ -1239,7 +1239,7 @@ eval_string_with_cref(VALUE self, VALUE >+ 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; >+@@ -1983,8 +1983,8 @@ rb_catch_protect(VALUE t, rb_block_call_ >+ { >+ int state; >+ volatile VALUE val = Qnil; /* OK */ >+- rb_thread_t *th = GET_THREAD(); >+- rb_control_frame_t *saved_cfp = th->cfp; >++ rb_thread_t *volatile th = GET_THREAD(); >++ rb_control_frame_t *volatile saved_cfp = th->cfp; >+ volatile VALUE tag = t; >+ >+ TH_PUSH_TAG(th); > >Property changes on: lang/ruby22/files/patch-vm_eval.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: lang/ruby22/files/patch-vm_trace.c >=================================================================== >--- lang/ruby22/files/patch-vm_trace.c (nonexistent) >+++ lang/ruby22/files/patch-vm_trace.c (working copy) >@@ -0,0 +1,11 @@ >+--- vm_trace.c.orig 2015-11-08 15:49:09.000000000 +0100 >++++ vm_trace.c 2016-01-10 19:11:46.862754000 +0100 >+@@ -390,7 +390,7 @@ rb_suppress_tracing(VALUE (*func)(VALUE) >+ 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; > >Property changes on: lang/ruby22/files/patch-vm_trace.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 206110
: 165370