PVS-StudioWarnings

PVS-Studio warning V640 for VirtualBox

Nov 20th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. STDMETHODIMP SessionMachine::EndTakingSnapshot(BOOL aSuccess)
  2. {
  3.   ....
  4.   if (fOnline)
  5.     //no need to test for whether the saved state file is shared:
  6.     //an online snapshot means that a new saved state file was
  7.     //created, which we must clean up now
  8.     RTFileDelete(mConsoleTaskData.mSnapshot->....);
  9.     machineLock.acquire();                  //<==
  10.  
  11.   mConsoleTaskData.mSnapshot->uninit();
  12.   machineLock.release();
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in VirtualBox project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V640 The code's operational logic does not correspond with its formatting. The statement is indented to the right, but it is always executed. It is possible that curly brackets are missing. snapshotimpl.cpp 1649
  19.  
  20. 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