PVS-StudioWarnings

PVS-Studio warning V523 for Clang

Nov 20th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. static bool CollectBSwapParts(....) {
  2.   ...
  3.   unsigned DestByteNo = InputByteNo + OverallLeftShift;
  4.   if (InputByteNo < ByteValues.size()/2) {
  5.     if (ByteValues.size()-1-DestByteNo != InputByteNo)
  6.       return true;
  7.   } else {
  8.     if (ByteValues.size()-1-DestByteNo != InputByteNo)
  9.       return true;
  10.   }
  11.   ...
  12. }
  13.  
  14. This suspicious code was found in Clang project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V523 The 'then' statement is equivalent to the 'else' statement. LLVMInstCombine instcombineandorxor.cpp 1387
  17.  
  18. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment