summaryrefslogtreecommitdiff
path: root/ext/stringio/stringio.c
diff options
context:
space:
mode:
authorAaron Patterson <[email protected]>2025-02-19 16:18:02 -0800
committergit <[email protected]>2025-02-20 00:18:08 +0000
commita27758ad4e6a24110f11f16cf62464981dc041a2 ()
tree1526e8516f4ae1637acb1386c501574b3625b435 /ext/stringio/stringio.c
parentc515da3d74779bd725f5bc60d6514d325515df0e (diff)
[ruby/stringio] Make sure shared buffer is copied on mutation
(https://.com/ruby/stringio/pull/117) We need to ensure shared buffers are made independent on mutation. Otherwise we could end up mutating unrelated string buffers. --------- https://.com/ruby/stringio/commit/5101cfb030 Co-authored-by: Aaron Patterson <[email protected]> Co-authored-by: Alan Wu <[email protected]> Co-authored-by: Aaron Patterson <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]>
-rw-r--r--ext/stringio/stringio.c1
1 files changed, 1 insertions, 0 deletions
@@ -180,6 +180,7 @@ check_modifiable(struct StringIO *ptr)
else if (OBJ_FROZEN_RAW(ptr->string)) {
rb_raise(rb_eIOError, "not modifiable string");
}
}
static VALUE