Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liberty expression lexer check if characters are found and use size if not for pin() #4876

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gadfort
Copy link
Contributor

@gadfort gadfort commented Jan 29, 2025

What are the reasons/motivation for this change?

When the clocked_on expression contains an expression like: D&!SE+SE&SI the lexer segfaults when processing the SI pin because find_first_of returns std::string::npos causing the calls to strsub to throw an exception.

Explain how this is achieved.

Check the return value and use the size of the string if those characters are not found.

If applicable, please suggest to reviewers how they can test the change.

I have a liberty file which was modified from one of the yosys testcases I can add, but I might need to guidance on how to integrate that as a test.
See attached (added the sdff cell for testing): normal_scan_ff.zip

@gadfort
Copy link
Contributor Author

gadfort commented Feb 4, 2025

@povik do you mind taking a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant