NoQ added a comment.

Nice catch!



================
Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:399
+
+  C.addTransition(State);
 }
----------------
MTC wrote:
> I have two questions may need @NoQ or @xazax.hun who is more familiar with 
> the analyzer engine help to answer.
> 
>   - `State` may not change at all, do we need a check here like [[ 
> https://github.com/llvm-mirror/clang/blob/master/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp#L227
>  | if (state != originalState) ]]
>   - A more basic problem is that do we need `originalState = State` trick. It 
> seems that `addTransitionImpl()` has a check about same state transition, see 
> [[ 
> https://github.com/llvm-mirror/clang/blob/master/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h#L339
>  | addTransitionImp() ]].
> 
> Thanks in advance!
> 
> 
> 
> It seems that `addTransitionImpl()` has a check about same state transition, 
> see `addTransitionImp()`.

Yep, you pretty much answered your question. The check in the checker code is 
unnecessary.


Repository:
  rC Clang

https://reviews.llvm.org/D47417



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to