diff options
author | Nobuyoshi Nakada <[email protected]> | 2019-08-05 10:51:52 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2019-08-05 10:51:52 +0900 |
commit | 8cfa3d861c393b7f2f35eaf30132edd8423ba59a (patch) | |
tree | 40ab742cf692bff24f4c874ad6ff4bcabfa3ea1e /load.c | |
parent | 29092d35d33d3a879634e173604edc9d201aa87a (diff) |
Do not expect RSTRING_PTR valid after rb_fstring
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1015,7 +1015,7 @@ rb_require_internal(VALUE fname, int safe) RUBY_DTRACE_HOOK(FIND_REQUIRE_RETURN, RSTRING_PTR(fname)); if (found) { - if (!path || !(path = rb_fstring(path), ftptr = load_lock(RSTRING_PTR(path)))) { + if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) { result = 0; } else if (!*ftptr) { @@ -1042,7 +1042,7 @@ rb_require_internal(VALUE fname, int safe) } } EC_POP_TAG(); - load_unlock(ftptr, !state); + if (ftptr) load_unlock(RSTRING_PTR(path), !state); rb_set_safe_level_force(saved.safe); if (state) { |