diff options
author | Koichi Sasada <ko1@atdot.net> | 2019-05-27 08:19:30 +0100 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2019-05-27 08:19:30 +0100 |
commit | b3602f1d20baa4e5f29b2baff2c265461af78f56 (patch) | |
tree | ff80ccc04e82bee372b757e4f35793929b5905fa /gc.c | |
parent | 35146c436820f35733982bac870e409c57888575 (diff) | |
download | ruby-b3602f1d20baa4e5f29b2baff2c265461af78f56.tar.gz |
check the object is in tomb_heap.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1087,8 +1087,21 @@ check_rvalue_consistency_force(const VALUE obj, int terminate) err++; } else if (!is_pointer_to_heap(objspace, (void *)obj)) { + /* check if it is in tomb_pages */ + struct heap_page *page; + list_for_each(&heap_tomb->pages, page, page_node) { + if (&page->start[0] <= (RVALUE *)obj && + (RVALUE *)obj < &page->start[page->total_slots]) { + fprintf(stderr, "check_rvalue_consistency: %p is in a tomb_heap (%p).\n", + (void *)obj, (void *)page); + err++; + goto skip; + } + } fprintf(stderr, "check_rvalue_consistency: %p is not a Ruby object.\n", (void *)obj); err++; + skip: + ; } else { const int wb_unprotected_bit = RVALUE_WB_UNPROTECTED_BITMAP(obj) != 0; |