summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-08 15:44:47 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-08 15:44:47 +0900
commit076f2e9d3eb1cee7e64e6fc666698060d08f25c9 (patch)
tree3aff8514b3ad801480815582073313aae626dc76 /load.c
parent78ff9b719c236b56956d446053256f8e30edf0c3 (diff)
downloadruby-076f2e9d3eb1cee7e64e6fc666698060d08f25c9.tar.gz
Make `volatile` the variable will be taken out from `EC_EXEC_TAG`
Diffstat (limited to 'load.c')
-rw-r--r--load.c7
1 files 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
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
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;