Merge pull request #421 from garytwong/fix-lpf-locate-assertion-failure

Fix assertion failure on invalid LOCATE input.
This commit is contained in:
David Shah 2020-04-07 09:44:22 +01:00 committed by GitHub
commit 571ad7d604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,6 +101,8 @@ bool Arch::applyLPF(std::string filename, std::istream &in)
if (words.at(3) != "SITE") if (words.at(3) != "SITE")
log_error("expected 'SITE' after 'LOCATE COMP %s' (on line %d)\n", cell.c_str(), lineno); log_error("expected 'SITE' after 'LOCATE COMP %s' (on line %d)\n", cell.c_str(), lineno);
auto fnd_cell = cells.find(id(cell)); auto fnd_cell = cells.find(id(cell));
if (words.size() > 5)
log_error("unexpected input following LOCATE clause (on line %d)\n", lineno);
if (fnd_cell != cells.end()) { if (fnd_cell != cells.end()) {
fnd_cell->second->attrs[id("LOC")] = strip_quotes(words.at(4)); fnd_cell->second->attrs[id("LOC")] = strip_quotes(words.at(4));
} }