]> granicus.if.org Git - clang/commitdiff
[analyzer] Remove the redundant check about same state transition in `ArrayBoundCheck...
authorHenry Wong <movietravelcode@outlook.com>
Wed, 30 May 2018 11:46:45 +0000 (11:46 +0000)
committerHenry Wong <movietravelcode@outlook.com>
Wed, 30 May 2018 11:46:45 +0000 (11:46 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333531 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp

index ebe9f99f962563eba1d786a1bdaee0f6a829169e..933380d494a49ad599fc76ab359817a9b788ff32 100644 (file)
@@ -125,7 +125,6 @@ void ArrayBoundCheckerV2::checkLocation(SVal location, bool isLoad,
   // 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(SVal location, bool isLoad,
   }
   while (false);
 
-  if (state != originalState)
-    checkerContext.addTransition(state);
+  checkerContext.addTransition(state);
 }
 
 void ArrayBoundCheckerV2::reportOOB(