From 9b4ac36d4af28cc8a050152ec0df8cbcee1ff56e Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 12 Jan 2022 11:12:47 +0300 Subject: Check pointer tag in all mark procedures (E2K) Issue #411 (bdwgc). Do not mark objects if its pointer tag is non-zero, not only in GC_mark_from and GC_push_all_eager, but also in add_back_edges, GC_ignore_self_finalize_mark_proc, GC_typed_mark_proc and GC_push_conditional_eager. * backgraph.c [MAKE_BACK_GRAPH] (add_back_edges): Change type of current_p local variable from word* to ptr_t. * typd_mlc.c (GC_typed_mark_proc): Likewise. * backgraph.c [MAKE_BACK_GRAPH] (add_back_edges): Use LOAD_WORD_OR_CONTINUE() instead of direct dereference of current_p. * finalize.c (GC_ignore_self_finalize_mark_proc): Likewise. * mark.c [WRAP_MARK_SOME && PARALLEL_MARK] (GC_push_conditional_eager): Likewise. * typd_mlc.c (GC_typed_mark_proc): Likewise. * finalize.c (GC_ignore_self_finalize_mark_proc): Rename q and r local variables to current_p and q, respectively. --- typd_mlc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'typd_mlc.c') diff --git a/typd_mlc.c b/typd_mlc.c index fb8990c6..4078e189 100644 --- a/typd_mlc.c +++ b/typd_mlc.c @@ -344,20 +344,21 @@ STATIC mse * GC_typed_mark_proc(word * addr, mse * mark_stack_ptr, mse * mark_stack_limit, word env) { word bm = GC_ext_descriptors[env].ed_bitmap; - word * current_p = addr; - word current; + ptr_t current_p = (ptr_t)addr; ptr_t greatest_ha = (ptr_t)GC_greatest_plausible_heap_addr; ptr_t least_ha = (ptr_t)GC_least_plausible_heap_addr; DECLARE_HDR_CACHE; INIT_HDR_CACHE; - for (; bm != 0; bm >>= 1, current_p++) { + for (; bm != 0; bm >>= 1, current_p += sizeof(word)) { if (bm & 1) { - current = *current_p; + word current; + + LOAD_WORD_OR_CONTINUE(current, current_p); FIXUP_POINTER(current); if (current >= (word)least_ha && current <= (word)greatest_ha) { PUSH_CONTENTS((ptr_t)current, mark_stack_ptr, - mark_stack_limit, (ptr_t)current_p); + mark_stack_limit, current_p); } } } -- cgit v1.2.1