diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-04-10 06:03:32 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-04-10 06:03:32 +0900 |
| commit | d0b30f4ce22e7f9e2396a2159d1a1ff81fcc6ca6 (patch) | |
| tree | c4670a8bd9ad3aa93a92e3e603f8b26589d7504b /mrbgems/mruby-struct/src/struct.c | |
| parent | b433001a1b0676b1bfbd9850c51fd8caed2c8c7b (diff) | |
| parent | e3beef065c2de80a843f329599b424676d83086c (diff) | |
| download | mruby-d0b30f4ce22e7f9e2396a2159d1a1ff81fcc6ca6.tar.gz mruby-d0b30f4ce22e7f9e2396a2159d1a1ff81fcc6ca6.zip | |
Merge pull request #4367 from shuujii/extract-frozen-checking-to-function
Extract frozen checking to function
Diffstat (limited to 'mrbgems/mruby-struct/src/struct.c')
| -rw-r--r-- | mrbgems/mruby-struct/src/struct.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/mrbgems/mruby-struct/src/struct.c b/mrbgems/mruby-struct/src/struct.c index c0ce71219..1df135a9f 100644 --- a/mrbgems/mruby-struct/src/struct.c +++ b/mrbgems/mruby-struct/src/struct.c @@ -87,10 +87,7 @@ mrb_struct_s_members_m(mrb_state *mrb, mrb_value klass) static void mrb_struct_modify(mrb_state *mrb, mrb_value strct) { - if (MRB_FROZEN_P(mrb_basic_ptr(strct))) { - mrb_raise(mrb, E_FROZEN_ERROR, "can't modify frozen struct"); - } - + mrb_check_frozen(mrb, mrb_basic_ptr(strct)); mrb_write_barrier(mrb, mrb_basic_ptr(strct)); } |
