Bugfix: entering '16:17' (or similar) into 'new layout' layer list made KLayout hang

This commit is contained in:
Matthias Koefferlein 2026-07-17 17:47:21 +02:00
parent abe9479ced
commit b21f253cf8
3 changed files with 13 additions and 3 deletions

View File

@ -190,7 +190,7 @@ static bool read_ld (tl::Extractor &ex, ld_type &l, bool with_relative)
}
}
void
bool
LayerProperties::read (tl::Extractor &ex, bool as_target)
{
layer = db::any_ld ();
@ -207,6 +207,8 @@ LayerProperties::read (tl::Extractor &ex, bool as_target)
layer = l;
datatype = d;
return true;
} else if (ex.try_read_word_or_quoted (name)) {
if (ex.test ("(")) {
@ -223,6 +225,10 @@ LayerProperties::read (tl::Extractor &ex, bool as_target)
}
return true;
} else {
return false;
}
}

View File

@ -91,8 +91,10 @@ struct DB_PUBLIC LayerProperties
* relative layer/datatype specifications in the format "*+1" or "*-100".
* "*" for layer or datatype is for "don't care" (on input) or "leave as is"
* (for output).
*
* Returns true, if a layer was read successfully.
*/
void read (tl::Extractor &ex, bool as_target = false);
bool read (tl::Extractor &ex, bool as_target = false);
/**
* @brief "Logical" equality

View File

@ -196,7 +196,9 @@ NewLayoutPropertiesDialog::exec_dialog (std::string &technology, std::string &ce
while (! ex.at_end ()) {
db::LayerProperties lp;
try {
lp.read (ex);
if (! lp.read (ex)) {
break;
}
} catch (...) {
break;
}