summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2019-05-27 08:19:30 +0100
committerKoichi Sasada <ko1@atdot.net>2019-05-27 08:19:30 +0100
commitb3602f1d20baa4e5f29b2baff2c265461af78f56 (patch)
treeff80ccc04e82bee372b757e4f35793929b5905fa /gc.c
parent35146c436820f35733982bac870e409c57888575 (diff)
check the object is in tomb_heap.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index ca66531ff7..2c89561868 100644
--- a/gc.c
+++ b/gc.c
@@ -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;