diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-03-20 19:15:38 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-20 19:15:38 +0900 |
commit | e019dd24df4ed7063ad80d4c2e4070141793f598 (patch) | |
tree | 735ab507d758c25c95441dee16b7f35bca0009ea /array.c | |
parent | bf3eaf39df9e0edc02040409b07bdd40b04bf8fa (diff) |
Ensure the receiver is modifiable before shrinking [Bug #17736]
* Ensure the receiver is modifiable before shinking [Bug #17736]
* Assert the receivers are not modified
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4296
Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -3846,6 +3846,7 @@ select_bang_ensure(VALUE a) if (i2 < len && i2 < i1) { long tail = 0; + rb_ary_modify(ary); if (i1 < len) { tail = len - i1; RARRAY_PTR_USE_TRANSIENT(ary, ptr, { |