Commit 6eb7886a authored by Simon Marlow's avatar Simon Marlow
Browse files

Fix an assertion that was not safe when running in parallel

parent ccd5aec2
......@@ -368,9 +368,18 @@ markWeakPtrList ( void )
last_w = &weak_ptr_list;
for (w = weak_ptr_list; w; w = w->link) {
// w might be WEAK, EVACUATED, or DEAD_WEAK (actually CON_STATIC) here
ASSERT(IS_FORWARDING_PTR(w->header.info)
|| w->header.info == &stg_DEAD_WEAK_info
|| get_itbl(w)->type == WEAK);
#ifdef DEBUG
{ // careful to do this assertion only reading the info ptr
// once, because during parallel GC it might change under our feet.
const StgInfoTable *info;
info = w->header.info;
ASSERT(IS_FORWARDING_PTR(info)
|| info == &stg_DEAD_WEAK_info
|| INFO_PTR_TO_STRUCT(info)->type == WEAK);
}
#endif
evacuate((StgClosure **)last_w);
w = *last_w;
if (w->header.info == &stg_DEAD_WEAK_info) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment