From 9151ed2fb2fa8c0648666cdfdb56e38ec3b15815 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Fri, 24 Sep 2021 08:17:56 +1200 Subject: [PATCH] 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 aa1fdd022e..c6e1012bdd 100644 --- a/variable.c +++ b/variable.c @@ -202,8 +202,7 @@ build_const_pathname(VALUE head, VALUE tail) 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