Skip to content

Commit

Permalink
Merge pull request #4876 from gadfort/segfault-lexer
Browse files Browse the repository at this point in the history
liberty expression lexer check if characters are found and use size if not for `pin()`
  • Loading branch information
povik authored Feb 7, 2025
2 parents 772b9c0 + 9534f4a commit fc88ea3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions passes/techmap/libparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ namespace Yosys

std::string pin() {
auto length = s.find_first_of("\t()'!^*& +|");
if (length == std::string::npos) {
// nothing found so use size of s
length = s.size();
}
auto pin = s.substr(0, length);
s = s.substr(length, s.size());
return pin;
Expand Down

0 comments on commit fc88ea3

Please sign in to comment.