Advertisement
PVS-StudioWarnings

PVS-Studio warning V501 for WebKit

Nov 21st, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. ALWAYS_INLINE int
  2. FEConvolveMatrix::getPixelValue(
  3.   PaintingData& paintingData, int x, int y)
  4. {
  5.   if (x >= 0 &&
  6.       x < paintingData.width &&
  7.       x >= 0 &&
  8.       y < paintingData.height)
  9.     return (y * paintingData.width + x) << 2;
  10.   ...
  11. }
  12.  
  13. This is what should have been written here: y >= 0 && y < paintingData.height
  14.  
  15. This suspicious code was found in WebKit project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V501 There are identical sub-expressions 'x >= 0' to the left and to the right of the '&&' operator. webcore_platform feconvolvematrix.cpp 289
  18.  
  19. 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
Advertisement