summaryrefslogtreecommitdiff
path: root/ext/stringio/stringio.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/stringio/stringio.c')
-rw-r--r--ext/stringio/stringio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 4041537d25..26287dd1b8 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -1868,6 +1868,8 @@ strio_set_encoding(int argc, VALUE *argv, VALUE self)
if (!NIL_P(ptr->string) && WRITABLE(self)
#if (RUBY_API_VERSION_MAJOR == 3 && RUBY_API_VERSION_MINOR >= 4) || RUBY_API_VERSION_MAJOR >= 4
// Do not attempt to modify chilled strings on Ruby 3.4+
+ // RUBY_FL_USER2 == STR_CHILLED_LITERAL
+ // RUBY_FL_USER3 == STR_CHILLED_SYMBOL_TO_S
&& !FL_TEST_RAW(ptr->string, RUBY_FL_USER2 | RUBY_FL_USER3)
#endif
) {