PVS-StudioWarnings

PVS-Studio warning V629 for Clang

Nov 11th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. Init *IntRecTy::convertValue(BitsInit *BI) {
  2.   int64_t Result = 0;
  3.   for (unsigned i = 0, e = BI->getNumBits(); i != e; ++i)
  4.     if (....) {
  5.       Result |= Bit->getValue() << i;
  6.     } else {
  7.       return 0;
  8.     }
  9.   return IntInit::get(Result);
  10. }
  11.  
  12. This suspicious code was found in Clang project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V629 Consider inspecting the 'Bit->getValue() << i' expression. Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type. record.cpp 248
  15.  
  16. 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