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

ruby-changes:68313

From: Nobuyoshi <ko1@a...>
Date: Fri, 8 Oct 2021 15:59:03 +0900 (JST)
Subject: [ruby-changes:68313] 076f2e9d3e (master): Make `volatile` the variable will be taken out from `EC_EXEC_TAG`

https://git.ruby-lang.org/ruby.git/commit/?id=076f2e9d3e

From 076f2e9d3eb1cee7e64e6fc666698060d08f25c9 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 8 Oct 2021 15:44:47 +0900
Subject: Make `volatile` the variable will be taken out from `EC_EXEC_TAG`

---
 load.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/load.c b/load.c
index 3c0c723f72..41e706b144 100644
--- a/load.c
+++ b/load.c
@@ -1081,7 +1081,7 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa https://github.com/ruby/ruby/blob/trunk/load.c#L1081
     char *volatile ftptr = 0;
     VALUE path;
     volatile VALUE saved_path;
-    VALUE realpath = 0;
+    volatile VALUE realpath = 0;
     VALUE realpaths = get_loaded_features_realpaths();
     volatile bool reset_ext_config = false;
     struct rb_ext_config prev_ext_config;
@@ -1167,8 +1167,9 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa https://github.com/ruby/ruby/blob/trunk/load.c#L1167
 
     if (result == TAG_RETURN) {
         rb_provide_feature(path);
-        if (realpath) {
-            rb_hash_aset(realpaths, rb_fstring(realpath), Qtrue);
+        VALUE real = realpath;
+        if (real) {
+            rb_hash_aset(realpaths, rb_fstring(real), Qtrue);
         }
     }
     ec->errinfo = saved.errinfo;
-- 
cgit v1.2.1


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

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