diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFImporter.cc index 4b136bb7e..92a8046ff 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFImporter.cc @@ -404,14 +404,14 @@ LEFImporter::read_nondefaultrule (db::Layout &layout) // read NONDEFAULTRULE sections std::string n = get (); - while (! test ("END")) { + while (! at_end () && ! test ("END")) { if (test ("LAYER")) { std::string l = get (); // read the width for the layer - while (! test ("END")) { + while (! at_end () && ! test ("END")) { if (test ("WIDTH")) { double w = get_double (); test (";"); @@ -452,7 +452,7 @@ LEFImporter::read_nondefaultrule (db::Layout &layout) void LEFImporter::read_viadef_by_rule (RuleBasedViaGenerator *vg, ViaDesc &via_desc, const std::string & /*n*/, double dbu) { - while (! test ("END")) { + while (! at_end () && ! test ("END")) { double x, y; @@ -1181,7 +1181,7 @@ LEFImporter::do_read (db::Layout &layout) LEFDEFSection section (this, "BEGINEXT"); // read over BEGINEXT sections - while (! test ("ENDEXT")) { + while (! at_end () && ! test ("ENDEXT")) { take (); } diff --git a/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImportTests.cc b/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImportTests.cc index 09b435dfb..0dcc0c646 100644 --- a/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImportTests.cc +++ b/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImportTests.cc @@ -320,6 +320,7 @@ TEST(lef7) TEST(lef8) { // this is rather a smoke test and throws a number of warnings + // (complete example) run_test (_this, "lef8", "lef:tech.lef+lef:a.lef", "au.oas.gz", default_options ()); } @@ -425,6 +426,7 @@ TEST(def15) TEST(def16) { // this is rather a smoke test + // (complete example) db::LEFDEFReaderOptions opt = default_options (); opt.set_macro_resolution_mode (1); run_test (_this, "def16", "lef:a.lef+lef:tech.lef+def:a.def", "au.oas.gz", opt); @@ -968,3 +970,9 @@ TEST(205_lef_resistance) run_test (_this, "issue-1214", "read:merged.nom.lef", "au.oas.gz", lefdef_opt, false); } +// issue 1282 +TEST(206_lef_spacing) +{ + run_test (_this, "issue-1282", "read:a.lef", 0, default_options (), false); +} +