This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Stability improvements for IteratorModeling functions
ClosedPublic

Authored by ASDenysPetrov on Apr 16 2020, 3:01 AM.

Details

Summary

Function path may lead to crash.

Fixed using local variable outside the scope through a pointer.
Fixed minor misspellings.
Added regression test.

This patch covers a bug https://bugs.llvm.org/show_bug.cgi?id=41485

Diff Detail

Event Timeline

ASDenysPetrov created this revision.Apr 16 2020, 3:01 AM
NoQ added a comment.Apr 16 2020, 10:23 PM

Tests please!

@baloghadamsoftware
I know you have much expertise here. Do you have some thoughts of how I can test exactly these cases?

ASDenysPetrov edited the summary of this revision. (Show Details)

@baloghadamsoftware
I've added a test for unscoped SVal, but still can't come up with if (!LPos || !RPos)
Could you, please, suggest me something?

ASDenysPetrov edited the summary of this revision. (Show Details)

I decided not to add changes of what I cannot cover by tests. So I removed them.

@NoQ @baloghadamsoftware
please, review my changes.

Thanks for fixing this!

This revision is now accepted and ready to land.Apr 23 2020, 11:13 AM
This revision was automatically updated to reflect the committed changes.