mirror of https://github.com/KLayout/klayout.git
[consider merging] fixed a crash happening while blending two OASIS files with ghost cells
This commit is contained in:
parent
5a401127a2
commit
abeab280a3
|
|
@ -240,7 +240,7 @@ CommonReaderBase::cell_for_instance (db::Layout &layout, const std::string &cn)
|
|||
}
|
||||
|
||||
void
|
||||
CommonReaderBase::merge_cell (db::Layout &layout, db::cell_index_type target_cell_index, db::cell_index_type src_cell_index, bool with_meta, bool no_duplicate_instances) const
|
||||
CommonReaderBase::merge_cell (db::Layout &layout, db::cell_index_type target_cell_index, db::cell_index_type src_cell_index, bool with_meta, bool no_duplicate_instances)
|
||||
{
|
||||
const db::Cell &src_cell = layout.cell (src_cell_index);
|
||||
db::Cell &target_cell = layout.cell (target_cell_index);
|
||||
|
|
@ -284,7 +284,7 @@ CommonReaderBase::merge_cell (db::Layout &layout, db::cell_index_type target_cel
|
|||
}
|
||||
|
||||
void
|
||||
CommonReaderBase::merge_cell_without_instances (db::Layout &layout, db::cell_index_type target_cell_index, db::cell_index_type src_cell_index, bool with_meta) const
|
||||
CommonReaderBase::merge_cell_without_instances (db::Layout &layout, db::cell_index_type target_cell_index, db::cell_index_type src_cell_index, bool with_meta)
|
||||
{
|
||||
const db::Cell &src_cell = layout.cell (src_cell_index);
|
||||
db::Cell &target_cell = layout.cell (target_cell_index);
|
||||
|
|
@ -311,6 +311,7 @@ CommonReaderBase::merge_cell_without_instances (db::Layout &layout, db::cell_ind
|
|||
|
||||
// finally delete the new cell
|
||||
layout.delete_cell (src_cell.cell_index ());
|
||||
m_temp_cells.erase (src_cell.cell_index ());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -242,12 +242,12 @@ protected:
|
|||
/**
|
||||
* @brief Merge (and delete) the src_cell into target_cell
|
||||
*/
|
||||
void merge_cell (db::Layout &layout, db::cell_index_type target_cell_index, db::cell_index_type src_cell_index, bool with_meta, bool no_duplicate_instances) const;
|
||||
void merge_cell (db::Layout &layout, db::cell_index_type target_cell_index, db::cell_index_type src_cell_index, bool with_meta, bool no_duplicate_instances);
|
||||
|
||||
/**
|
||||
* @brief Merge (and delete) the src_cell into target_cell without instances
|
||||
*/
|
||||
void merge_cell_without_instances (db::Layout &layout, db::cell_index_type target_cell_index, db::cell_index_type src_cell_index, bool with_meta) const;
|
||||
void merge_cell_without_instances (db::Layout &layout, db::cell_index_type target_cell_index, db::cell_index_type src_cell_index, bool with_meta);
|
||||
|
||||
/**
|
||||
* @brief Gets the layer name map
|
||||
|
|
|
|||
|
|
@ -679,3 +679,24 @@ TEST(DuplicateCellname)
|
|||
EXPECT_EQ (ex.msg ().find ("Same cell name TOP, but different IDs: 3 and 0 (position=1070, cell=)"), size_t (0));
|
||||
}
|
||||
}
|
||||
|
||||
TEST(BlendCrash)
|
||||
{
|
||||
db::Manager m (false);
|
||||
db::Layout layout (&m);
|
||||
|
||||
{
|
||||
tl::InputStream file (tl::testdata () + "/oasis/blend_crash1.oas");
|
||||
db::OASISReader reader (file);
|
||||
reader.read (layout);
|
||||
}
|
||||
|
||||
{
|
||||
tl::InputStream file (tl::testdata () + "/oasis/blend_crash2.oas");
|
||||
db::OASISReader reader (file);
|
||||
reader.read (layout);
|
||||
}
|
||||
|
||||
std::string fn_au (tl::testdata () + "/oasis/blend_crash_au.gds.gz");
|
||||
db::compare_layouts (_this, layout, fn_au, db::WriteGDS2, 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue