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

ruby-changes:56815

From: Nobuyoshi <ko1@a...>
Date: Mon, 5 Aug 2019 11:59:28 +0900 (JST)
Subject: [ruby-changes:56815] Nobuyoshi Nakada: 8cfa3d861c (master): Do not expect RSTRING_PTR valid after rb_fstring

https://git.ruby-lang.org/ruby.git/commit/?id=8cfa3d861c

From 8cfa3d861c393b7f2f35eaf30132edd8423ba59a Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 5 Aug 2019 10:51:52 +0900
Subject: Do not expect RSTRING_PTR valid after rb_fstring


diff --git a/load.c b/load.c
index c7f165f..56dab41 100644
--- a/load.c
+++ b/load.c
@@ -1015,7 +1015,7 @@ rb_require_internal(VALUE fname, int safe) https://github.com/ruby/ruby/blob/trunk/load.c#L1015
 	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) https://github.com/ruby/ruby/blob/trunk/load.c#L1042
 	}
     }
     EC_POP_TAG();
-    load_unlock(ftptr, !state);
+    if (ftptr) load_unlock(RSTRING_PTR(path), !state);
 
     rb_set_safe_level_force(saved.safe);
     if (state) {
-- 
cgit v0.10.2


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

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