Merge pull request #4876 from gadfort/segfault-lexer

liberty expression lexer check if characters are found and use size if not for `pin()`
This commit is contained in:
Martin Povišer 2025-02-07 20:24:08 +01:00 committed by GitHub
commit fc88ea360e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -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;