ruby-changes:68121
From: Samuel <ko1@a...>
Date: Sat, 25 Sep 2021 15:19:39 +0900 (JST)
Subject: [ruby-changes:68121] 9151ed2fb2 (master): Return fstrings from `build_const_pathname`.
https://git.ruby-lang.org/ruby.git/commit/?id=9151ed2fb2 From 9151ed2fb2fa8c0648666cdfdb56e38ec3b15815 Mon Sep 17 00:00:00 2001 From: Samuel Williams <samuel.williams@o...> Date: Fri, 24 Sep 2021 08:17:56 +1200 Subject: Return fstrings from `build_const_pathname`. It's possible for `build_const_pathname` to be called when `rb_cString` is still NULL. There is a fix-up step when `rb_cString` is initialized, but it only applies to `fstring` instances. --- variable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/variable.c b/variable.c index aa1fdd0..c6e1012 100644 --- a/variable.c +++ b/variable.c @@ -202,8 +202,7 @@ build_const_pathname(VALUE head, VALUE tail) https://github.com/ruby/ruby/blob/trunk/variable.c#L202 VALUE path = rb_str_dup(head); rb_str_cat2(path, "::"); rb_str_append(path, tail); - OBJ_FREEZE(path); - return path; + return rb_fstring(path); } static VALUE -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/