r333531 - [analyzer] Remove the redundant check about same state transition in `ArrayBoundCheckerV2.cpp`.

Henry Wong via cfe-commits cfe-commits at lists.llvm.org
Wed May 30 04:46:46 PDT 2018


Author: henrywong
Date: Wed May 30 04:46:45 2018
New Revision: 333531

URL: http://llvm.org/viewvc/llvm-project?rev=333531&view=rev
Log:
[analyzer] Remove the redundant check about same state transition in `ArrayBoundCheckerV2.cpp`.

Summary: Since the `addTransitionImpl()` has a check about same state transition, there is no need to check it in `ArrayBoundCheckerV2.cpp`.

Reviewers: NoQ, xazax.hun, george.karpenkov

Reviewed By: NoQ

Subscribers: szepet, rnkovacs, a.sidorin, cfe-commits, MTC

Differential Revision: https://reviews.llvm.org/D47451

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp?rev=333531&r1=333530&r2=333531&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp Wed May 30 04:46:45 2018
@@ -125,7 +125,6 @@ void ArrayBoundCheckerV2::checkLocation(
   // have some flexibility in defining the base region, we can achieve
   // various levels of conservatism in our buffer overflow checking.
   ProgramStateRef state = checkerContext.getState();
-  ProgramStateRef originalState = state;
 
   SValBuilder &svalBuilder = checkerContext.getSValBuilder();
   const RegionRawOffsetV2 &rawOffset =
@@ -224,8 +223,7 @@ void ArrayBoundCheckerV2::checkLocation(
   }
   while (false);
 
-  if (state != originalState)
-    checkerContext.addTransition(state);
+  checkerContext.addTransition(state);
 }
 
 void ArrayBoundCheckerV2::reportOOB(




More information about the cfe-commits mailing list