PVS-StudioWarnings

PVS-Studio warning V519 for Clang

Nov 20th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. void llvm::EmitAnyX86InstComments(....) {
  2.   ...
  3.   case X86::VPERMILPSri:
  4.     DecodeVPERMILPSMask(4, MI->getOperand(2).getImm(),
  5.                         ShuffleMask);
  6.     Src1Name = getRegName(MI->getOperand(0).getReg());
  7.   case X86::VPERMILPSYri:
  8.     DecodeVPERMILPSMask(8, MI->getOperand(2).getImm(),
  9.                         ShuffleMask);
  10.     Src1Name = getRegName(MI->getOperand(0).getReg());
  11.     break;
  12.   ...
  13. }
  14.  
  15. The break operator is missing.
  16.  
  17. This suspicious code was found in Clang project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V519 The 'Src1Name' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 211, 215. LLVMX86AsmPrinter x86instcomments.cpp 215
  20.  
  21. 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