mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Do not expect RSTRING_PTR valid after rb_fstring
This commit is contained in:
parent
29092d35d3
commit
8cfa3d861c
1 changed files with 2 additions and 2 deletions
4
load.c
4
load.c
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue