diff --git a/network_process/src/post_topo/patch_propagation.cpp b/network_process/src/post_topo/patch_propagation.cpp index d7574ad..81c71a5 100644 --- a/network_process/src/post_topo/patch_propagation.cpp +++ b/network_process/src/post_topo/patch_propagation.cpp @@ -141,12 +141,13 @@ dynamic_bitset_mp<> filter_cells_by_boolean(const baked_blobtree_t& stacked_nodes.emplace(std::move(front_info)); iter++; - while (iter != tree.nodes.end() - 1) { - // each out iteration must start with leaf node + while (iter != tree.nodes.end()) { + // each out iteration must start with leaf node, only 1 leaf node is absorbed in one iteration assert(iter->is_primitive_node()); compact_node_info temp_info{std::move(cell_primitive_signs[iter->primitive_index]), iter->parent_index}; iter++; // to parent or neighboring node - while (temp_info.parent_index == stacked_nodes.top().parent_index) { + while (!stacked_nodes.empty() && temp_info.parent_index == stacked_nodes.top().parent_index) { + // do bool operation, util meet next primitive node. assert(iter->is_operation_node()); const auto& other_cell_sign = stacked_nodes.top().cell_signs; @@ -168,7 +169,7 @@ dynamic_bitset_mp<> filter_cells_by_boolean(const baked_blobtree_t& } assert(stacked_nodes.size() == 1); - assert(stacked_nodes.top().parent_index == tree.nodes.size() - 1); + assert(stacked_nodes.top().parent_index == 0xFFFFFFFF); return stacked_nodes.top().cell_signs; } \ No newline at end of file