diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-04 15:21:49 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2020-03-13 22:34:09 +0900 |
commit | c7e0ce67430b5e312eb626a2c2f4b6a810b3b68b (patch) | |
tree | a0ad092c4501cfde64795ab3ef7dd01c7b452965 /load.c | |
parent | 7518b4e945675df9aca223c30ca711e1d82341ec (diff) | |
download | ruby-c7e0ce67430b5e312eb626a2c2f4b6a810b3b68b.tar.gz |
Add the loaded feature after no exception raised
Retrying after rescued `require` should try to load the same
library again. [Bug #16607]
(cherry picked from commit 7d6903dc476f982e7b432adbeef3a3d9372a309f)
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1007,7 +1007,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception) result = 0; } else if (!*ftptr) { - rb_provide_feature(path); result = TAG_RETURN; } else { @@ -1022,7 +1021,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception) rb_ary_push(ruby_dln_librefs, LONG2NUM(handle)); break; } - rb_provide_feature(path); result = TAG_RETURN; } } @@ -1056,6 +1054,7 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception) rb_exc_raise(ec->errinfo); } + if (result == TAG_RETURN) rb_provide_feature(path); ec->errinfo = errinfo; RUBY_DTRACE_HOOK(REQUIRE_RETURN, RSTRING_PTR(fname)); |