PVS-StudioWarnings

PVS-Studio warning V612 for Chromium

Nov 17th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. scoped_ptr<ActionInfo> ActionInfo::Load(....)
  2. {
  3.   ....
  4.   for (base::ListValue::const_iterator iter = icons->begin();
  5.         iter != icons->end(); ++iter)
  6.   {
  7.     std::string path;
  8.     if (....);
  9.       return scoped_ptr<ActionInfo>();
  10.     }
  11.  
  12.     result->default_icon.Add(....);
  13.     break;
  14.   }
  15.   ....
  16. }
  17.  
  18. This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V612 An unconditional 'break' within a loop. action_info.cc 76
  21.  
  22. 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