diff options
| author | Benoit Daloze <eregontp@gmail.com> | 2025-06-14 13:32:51 +0200 |
|---|---|---|
| committer | Benoit Daloze <eregontp@gmail.com> | 2025-06-16 22:59:10 +0200 |
| commit | 83fb07fb2c97b9922450979fa4a56f43324317a9 (patch) | |
| tree | f156eeadbfbe80578a9fa2d8bf7f0edc07f296c7 /string.c | |
| parent | cce4bfdca9e001ccac38b4f3125627b5c0d0e9f2 (diff) | |
[Bug #20998] Check if the string is frozen in rb_str_locktmp() & rb_str_unlocktmp()
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13615
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -3664,6 +3664,7 @@ RUBY_ALIAS_FUNCTION(rb_str_dup_frozen(VALUE str), rb_str_new_frozen, (str)) VALUE rb_str_locktmp(VALUE str) { + rb_check_frozen(str); if (FL_TEST(str, STR_TMPLOCK)) { rb_raise(rb_eRuntimeError, "temporal locking already locked string"); } @@ -3674,6 +3675,7 @@ rb_str_locktmp(VALUE str) VALUE rb_str_unlocktmp(VALUE str) { + rb_check_frozen(str); if (!FL_TEST(str, STR_TMPLOCK)) { rb_raise(rb_eRuntimeError, "temporal unlocking already unlocked string"); } |
