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

added NoneType check to preanalysis.py #3

Closed
wants to merge 1 commit into from

Conversation

sei-cabidi
Copy link

Added a check to see if the line in the input is NoneType before calling .group. This will prevent AttributeError: 'NoneType' object has no attribute 'group'.

Signed-off-by: Collin Abidi <cabidi@mac-augustapple.ad.sei.cmu.edu>
@dtrilla
Copy link
Contributor

dtrilla commented Dec 16, 2022

Hi! I've looked deeper into this and found out the real cause behind this error. The filter for lines void of brackets comes right before, where we check if the name of the basic block (BB) is present in that line. Turns out some of the BBs names can be single letters or numbers (in this case 'r' which matched in 'O r igin'), hence allowing the line to be searched for brackets.

I've patched this behavior by strictly searching the name of the basic block at the begging of the line instead of searching for appearances in the line:

See commit ba972a1 . I have added your proposed changes, either way, turns out the regex package changed behavior from python 3.7 to 3.8, which might be why I didn't catch it the first time, since most of the testing happened on a native build. I think it doesn't hurt to add extra checks to it.

Thanks a lot for looking into 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.

2 participants