- for (block_rec = rec->list, prev = NULL; block_rec;
- prev = block_rec, block_rec = block_rec->next) {
+ /* If the block is marked as dead, don't compile it, it will be removed
+ * as soon as it's safe. */
+ if (block->flags & BLOCK_IS_DEAD)
+ goto out_unlock;
+
+ for (elm = slist_first(&rec->slist), prev = NULL; elm;
+ prev = elm, elm = elm->next) {
+ block_rec = container_of(elm, struct block_rec, slist);
+