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

Fix nilptr crash in usesCall #22

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Fix nilptr crash in usesCall #22

merged 1 commit into from
Jun 19, 2024

Conversation

trixnz
Copy link
Contributor

@trixnz trixnz commented Jun 18, 2024

In usesCall(), there are circumstances where the ast.Ident doesn't have an Obj instance, but the line found = ok && id.Obj.Decl == sv.id.Obj.Decl assumes that it it will always have an instance.

I couldn't find an obvious pattern that explains when this happens, but it happens often enough in our code base that I figured I'd just add a nilptr check on the expression.

@coveralls
Copy link

coveralls commented Jun 18, 2024

Pull Request Test Coverage Report for Build 9565818687

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 83.942%

Totals Coverage Status
Change from base Build 8792199145: 0.0%
Covered Lines: 345
Relevant Lines: 411

💛 - Coveralls

Copy link
Owner

@jjti jjti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you thank you!

@jjti jjti merged commit 93b73ef into jjti:main Jun 19, 2024
2 of 3 checks passed
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.

None yet

3 participants