diff options
author | Koichi Sasada <[email protected]> | 2021-11-16 18:14:50 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2021-11-17 22:21:42 +0900 |
commit | 7ec1fc37f4c87c691555e76d51b6590761b3ec64 (patch) | |
tree | a5ff117b1f2028a05c0cfa437cd679781b914fc6 /iseq.c | |
parent | 8d7116552dace6d0a9a8f0bbe2fe0f02fcff6532 (diff) |
add `VM_CALLCACHE_ON_STACK`
check if iseq refers to on stack CC (it shouldn't).
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5122
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -366,12 +366,17 @@ rb_iseq_mark(const rb_iseq_t *iseq) if (vm_ci_markable(ci)) { rb_gc_mark_movable((VALUE)ci); } - if (cc && vm_cc_markable(cc)) { - if (!vm_cc_invalidated_p(cc)) { - rb_gc_mark_movable((VALUE)cc); - } - else { - cds[i].cc = rb_vm_empty_cc(); + + if (cc) { + VM_ASSERT((cc->flags & VM_CALLCACHE_ON_STACK) == 0); + + if (vm_cc_markable(cc)) { + if (!vm_cc_invalidated_p(cc)) { + rb_gc_mark_movable((VALUE)cc); + } + else { + cds[i].cc = rb_vm_empty_cc(); + } } } } |