Skip to content

Commit

Permalink
Fixed #493 (assertion in MacOS build)
Browse files Browse the repository at this point in the history
Problem was: default-constructed iterators are not the same in clang's STL
  • Loading branch information
Matthias committed Jun 20, 2020
1 parent e71c0dc commit 41dcb43
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/db/db/dbHierarchyBuilder.cc
Expand Up @@ -31,6 +31,9 @@ namespace db

static HierarchyBuilderShapeInserter def_inserter;

static HierarchyBuilder::cell_map_type null_map;
static HierarchyBuilder::cell_map_type::const_iterator null_iterator = null_map.end ();

// -------------------------------------------------------------------------------------------

int
Expand Down Expand Up @@ -168,7 +171,7 @@ HierarchyBuilder::reset ()
m_cell_map.clear ();
m_cells_seen.clear ();
m_cell_stack.clear ();
m_cm_entry = cell_map_type::const_iterator ();
m_cm_entry = null_iterator;
m_cm_new_entry = false;
}

Expand Down Expand Up @@ -263,14 +266,14 @@ HierarchyBuilder::end (const RecursiveShapeIterator *iter)
m_cells_seen.clear ();
mp_initial_cell = m_cell_stack.empty () ? 0 : m_cell_stack.front ().second.front ();
m_cell_stack.clear ();
m_cm_entry = cell_map_type::const_iterator ();
m_cm_entry = null_iterator;
m_cm_new_entry = false;
}

void
HierarchyBuilder::enter_cell (const RecursiveShapeIterator * /*iter*/, const db::Cell * /*cell*/, const db::Box & /*region*/, const box_tree_type * /*complex_region*/)
{
tl_assert (m_cm_entry != m_cell_map.end () && m_cm_entry != cell_map_type::const_iterator ());
tl_assert (m_cm_entry != m_cell_map.end () && m_cm_entry != null_iterator);

m_cells_seen.insert (m_cm_entry->first);

Expand Down

0 comments on commit 41dcb43

Please sign in to comment.