зеркало из https://github.com/github/ruby.git
[Fixes #17622] Mark and move the previous ep
This commit is contained in:
Родитель
1f0e0dfb22
Коммит
15dbaa0b54
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);
|
||||
|
||||
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)) {
|
||||
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]));
|
||||
|
@ -2846,6 +2851,11 @@ rb_execution_context_mark(const rb_execution_context_t *ec)
|
|||
rb_gc_mark_movable((VALUE)cfp->block_code);
|
||||
|
||||
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)) {
|
||||
rb_gc_mark_movable(ep[VM_ENV_DATA_INDEX_ENV]);
|
||||
rb_gc_mark(ep[VM_ENV_DATA_INDEX_ME_CREF]);
|
||||
|
|
Загрузка…
Ссылка в новой задаче