mirror of https://github.com/YosysHQ/yosys.git
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:
commit
fc88ea360e
|
@ -59,6 +59,10 @@ namespace Yosys
|
||||||
|
|
||||||
std::string pin() {
|
std::string pin() {
|
||||||
auto length = s.find_first_of("\t()'!^*& +|");
|
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);
|
auto pin = s.substr(0, length);
|
||||||
s = s.substr(length, s.size());
|
s = s.substr(length, s.size());
|
||||||
return pin;
|
return pin;
|
||||||
|
|
Loading…
Reference in New Issue