File tree 2 files changed +3
-12
lines changed
2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -51,18 +51,11 @@ static long strio_write(VALUE self, VALUE str);
51
51
#define IS_STRIO (obj ) (rb_typeddata_is_kind_of((obj), &strio_data_type))
52
52
#define error_inval (msg ) (rb_syserr_fail(EINVAL, msg))
53
53
#define get_enc (ptr ) ((ptr)->enc ? (ptr)->enc : !NIL_P((ptr)->string) ? rb_enc_get((ptr)->string) : NULL)
54
- #ifndef HAVE_RB_STR_CHILLED_P
55
- static bool
56
- rb_str_chilled_p (VALUE str )
57
- {
58
- return false;
59
- }
60
- #endif
61
54
62
55
static bool
63
56
readonly_string_p (VALUE string )
64
57
{
65
- return OBJ_FROZEN_RAW (string ) && ! rb_str_chilled_p ( string ) ;
58
+ return OBJ_FROZEN_RAW (string );
66
59
}
67
60
68
61
static struct StringIO *
@@ -184,9 +177,6 @@ check_modifiable(struct StringIO *ptr)
184
177
if (NIL_P (ptr -> string )) {
185
178
/* Null device StringIO */
186
179
}
187
- else if (rb_str_chilled_p (ptr -> string )) {
188
- rb_str_modify (ptr -> string );
189
- }
190
180
else if (OBJ_FROZEN_RAW (ptr -> string )) {
191
181
rb_raise (rb_eIOError , "not modifiable string" );
192
182
}
Original file line number Diff line number Diff line change @@ -990,7 +990,8 @@ def test_coderange_after_overwrite
990
990
assert_predicate ( s . string , :ascii_only? )
991
991
end
992
992
993
- if eval ( %{ "test".frozen? && !"test".equal?("test") } ) # Ruby 3.4+ chilled strings
993
+ require "objspace"
994
+ if ObjectSpace . respond_to? ( :dump ) && ObjectSpace . dump ( eval ( %{"test"} ) ) . include? ( '"chilled":true' ) # Ruby 3.4+ chilled strings
994
995
def test_chilled_string
995
996
chilled_string = eval ( %{""} )
996
997
io = StringIO . new ( chilled_string )
You can’t perform that action at this time.
0 commit comments