Home

[analyzer] Extend IdenticalExprChecker to check the two branches of an if.

Press ? to show keyboard shortcuts.
Committed
jroseFeb 19 2014, 9:44 AM
Parents
rL201700: Add back r201608, r201622, r201624 and r201625
Branches
Unknown
Tags
Unknown
Subscribers
None
Projects
None
Description

[analyzer] Extend IdenticalExprChecker to check the two branches of an if.

This extends the checks for identical expressions to handle identical
statements, and compares the consequent and alternative ("then" and "else")
branches of an if-statement to see if they are identical, treating a single
statement surrounded by braces as equivalent to one without braces.

This does /not/ check subsequent branches in an if/else chain, let alone
branches that are not consecutive. This may improve in a future patch, but
it would certainly take more work.

Patch by Daniel Fahlgren!

rL201701

cfe/trunk/lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp

Loading...

cfe/trunk/test/Analysis/identical-expressions.cpp

Loading...

cfe/trunk/test/Analysis/misc-ps-region-store.cpp

Loading...

Add Comment