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

ruby-changes:58222

From: Nobuyoshi <ko1@a...>
Date: Sat, 12 Oct 2019 18:14:47 +0900 (JST)
Subject: [ruby-changes:58222] 04333da7be (master): Suppress "clobbered" warnings by gcc 9.2.0

https://git.ruby-lang.org/ruby.git/commit/?id=04333da7be

From 04333da7beb3e50daf5f53ef7fe24b253a1a26ef Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 12 Oct 2019 18:14:15 +0900
Subject: Suppress "clobbered" warnings by gcc 9.2.0


diff --git a/eval.c b/eval.c
index 24228ca..64149d2 100644
--- a/eval.c
+++ b/eval.c
@@ -189,6 +189,7 @@ rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex) https://github.com/ruby/ruby/blob/trunk/eval.c#L189
     volatile VALUE errs[2] = { Qundef, Qundef };
     int nerr;
     rb_thread_t *th = rb_ec_thread_ptr(ec);
+    rb_thread_t *const volatile th0 = th;
     volatile int sysex = EXIT_SUCCESS;
     volatile int step = 0;
 
@@ -196,9 +197,11 @@ rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex) https://github.com/ruby/ruby/blob/trunk/eval.c#L197
     rb_threadptr_check_signal(th);
     EC_PUSH_TAG(ec);
     if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+        th = th0;
         SAVE_ROOT_JMPBUF(th, { RUBY_VM_CHECK_INTS(ec); });
 
       step_0: step++;
+        th = th0;
         errs[1] = ec->errinfo;
         if (THROW_DATA_P(ec->errinfo)) ec->errinfo = Qnil;
 	rb_set_safe_level_force(0);
@@ -207,6 +210,7 @@ rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex) https://github.com/ruby/ruby/blob/trunk/eval.c#L210
         SAVE_ROOT_JMPBUF(th, rb_ec_teardown(ec));
 
       step_1: step++;
+        th = th0;
 	/* protect from Thread#raise */
 	th->status = THREAD_KILLED;
 
@@ -220,6 +224,7 @@ rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex) https://github.com/ruby/ruby/blob/trunk/eval.c#L224
 	}
 	if (ex == 0) ex = state;
     }
+    th = th0;
     ec->errinfo = errs[1];
     sysex = error_handle(ec, ex);
 
@@ -548,10 +553,10 @@ static void https://github.com/ruby/ruby/blob/trunk/eval.c#L553
 setup_exception(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE cause)
 {
     VALUE e;
-    const char *file = 0;
     int line;
+    const char *file = rb_source_location_cstr(&line);
+    const char *const volatile file0 = file;
 
-    file = rb_source_location_cstr(&line);
     if ((file && !NIL_P(mesg)) || (cause != Qundef))  {
 	volatile int state = 0;
 
@@ -574,6 +579,7 @@ setup_exception(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE https://github.com/ruby/ruby/blob/trunk/eval.c#L579
 	    rb_ec_reset_raised(ec);
 	}
 	EC_POP_TAG();
+        file = file0;
 	if (state) goto fatal;
     }
 
-- 
cgit v0.10.2


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

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