summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorRĂ´mulo Ceccon <romuloceccon@gmail.com>2023-03-03 14:38:49 +0100
committerJean Boussier <jean.boussier@gmail.com>2023-03-03 15:32:25 +0100
commitd78ae78fd76e556e281a743c75bea4c0bb81ed8c (patch)
treea8d223114e7f718df7d037a3d59a6a7b0f9a2061 /string.c
parentb49053a6be3cc449678609f62048b7aed3a1f839 (diff)
downloadruby-d78ae78fd76e556e281a743c75bea4c0bb81ed8c.tar.gz
rb_str_modify_expand: clear the string coderange
[Bug #19468] b0b9f7201acab05c2a3ad92c3043a1f01df3e17f errornously stopped clearing the coderange. Since `rb_str_modify` clears it, `rb_str_modify_expand` should too.
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 6fd5866336..f556cdf180 100644
--- a/string.c
+++ b/string.c
@@ -2473,6 +2473,7 @@ rb_str_modify_expand(VALUE str, long expand)
else if (expand > 0) {
RESIZE_CAPA_TERM(str, len + expand, termlen);
}
+ ENC_CODERANGE_CLEAR(str);
}
/* As rb_str_modify(), but don't clear coderange */