Advertisement
PVS-StudioWarnings

PVS-Studio warning V612 for Chromium

Nov 24th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. ResourceProvider::ResourceId
  2. PictureLayerImpl::ContentsResourceId() const
  3. {
  4.   ....
  5.   for (PictureLayerTilingSet::CoverageIterator iter(....);
  6.        iter;
  7.        ++iter)
  8.   {
  9.     if (!*iter)
  10.       return 0;
  11.  
  12.     const ManagedTileState::TileVersion& tile_version = ....;
  13.  
  14.     if (....)
  15.       return 0;
  16.  
  17.     if (iter.geometry_rect() != content_rect)
  18.       return 0;
  19.  
  20.     return tile_version.get_resource_id();
  21.   }
  22.   return 0;
  23. }
  24.  
  25. This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
  26. Warning message is:
  27. V612 An unconditional 'return' within a loop. picture_layer_impl.cc 638
  28.  
  29. 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