1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.
This commit is contained in:
Samuel Williams 2021-09-24 08:17:56 +12:00
parent 13b17cb8fc
commit 9151ed2fb2
Notes: git 2021-09-25 15:19:40 +09:00

View file

@ -202,8 +202,7 @@ build_const_pathname(VALUE head, VALUE tail)
VALUE path = rb_str_dup(head); VALUE path = rb_str_dup(head);
rb_str_cat2(path, "::"); rb_str_cat2(path, "::");
rb_str_append(path, tail); rb_str_append(path, tail);
OBJ_FREEZE(path); return rb_fstring(path);
return path;
} }
static VALUE static VALUE