mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[Fixes #17622] Mark and move the previous ep
This commit is contained in:
parent
1f0e0dfb22
commit
15dbaa0b54
Notes:
git
2021-02-13 04:24:32 +09:00
1 changed files with 10 additions and 0 deletions
10
vm.c
10
vm.c
|
@ -2806,6 +2806,11 @@ rb_execution_context_update(const rb_execution_context_t *ec)
|
||||||
cfp->block_code = (void *)rb_gc_location((VALUE)cfp->block_code);
|
cfp->block_code = (void *)rb_gc_location((VALUE)cfp->block_code);
|
||||||
|
|
||||||
if (!VM_ENV_LOCAL_P(ep)) {
|
if (!VM_ENV_LOCAL_P(ep)) {
|
||||||
|
const VALUE *prev_ep = VM_ENV_PREV_EP(ep);
|
||||||
|
if (VM_ENV_FLAGS(prev_ep, VM_ENV_FLAG_ESCAPED)) {
|
||||||
|
VM_FORCE_WRITE(&prev_ep[VM_ENV_DATA_INDEX_ENV], rb_gc_location(prev_ep[VM_ENV_DATA_INDEX_ENV]));
|
||||||
|
}
|
||||||
|
|
||||||
if (VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED)) {
|
if (VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED)) {
|
||||||
VM_FORCE_WRITE(&ep[VM_ENV_DATA_INDEX_ENV], rb_gc_location(ep[VM_ENV_DATA_INDEX_ENV]));
|
VM_FORCE_WRITE(&ep[VM_ENV_DATA_INDEX_ENV], rb_gc_location(ep[VM_ENV_DATA_INDEX_ENV]));
|
||||||
VM_FORCE_WRITE(&ep[VM_ENV_DATA_INDEX_ME_CREF], rb_gc_location(ep[VM_ENV_DATA_INDEX_ME_CREF]));
|
VM_FORCE_WRITE(&ep[VM_ENV_DATA_INDEX_ME_CREF], rb_gc_location(ep[VM_ENV_DATA_INDEX_ME_CREF]));
|
||||||
|
@ -2846,6 +2851,11 @@ rb_execution_context_mark(const rb_execution_context_t *ec)
|
||||||
rb_gc_mark_movable((VALUE)cfp->block_code);
|
rb_gc_mark_movable((VALUE)cfp->block_code);
|
||||||
|
|
||||||
if (!VM_ENV_LOCAL_P(ep)) {
|
if (!VM_ENV_LOCAL_P(ep)) {
|
||||||
|
const VALUE *prev_ep = VM_ENV_PREV_EP(ep);
|
||||||
|
if (VM_ENV_FLAGS(prev_ep, VM_ENV_FLAG_ESCAPED)) {
|
||||||
|
rb_gc_mark_movable(prev_ep[VM_ENV_DATA_INDEX_ENV]);
|
||||||
|
}
|
||||||
|
|
||||||
if (VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED)) {
|
if (VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED)) {
|
||||||
rb_gc_mark_movable(ep[VM_ENV_DATA_INDEX_ENV]);
|
rb_gc_mark_movable(ep[VM_ENV_DATA_INDEX_ENV]);
|
||||||
rb_gc_mark(ep[VM_ENV_DATA_INDEX_ME_CREF]);
|
rb_gc_mark(ep[VM_ENV_DATA_INDEX_ME_CREF]);
|
||||||
|
|
Loading…
Reference in a new issue