mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[Bug #20752] Slice of readonly IO::Buffer
also should be readonly
This commit is contained in:
parent
b93c51c114
commit
637067440f
Notes:
git
2024-09-30 11:40:03 +00:00
2 changed files with 13 additions and 0 deletions
|
@ -1532,6 +1532,7 @@ rb_io_buffer_slice(struct rb_io_buffer *buffer, VALUE self, size_t offset, size_
|
|||
struct rb_io_buffer *slice = NULL;
|
||||
TypedData_Get_Struct(instance, struct rb_io_buffer, &rb_io_buffer_type, slice);
|
||||
|
||||
slice->flags |= (buffer->flags & RB_IO_BUFFER_READONLY);
|
||||
slice->base = (char*)buffer->base + offset;
|
||||
slice->size = length;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue