PVS-StudioWarnings

PVS-Studio warning V547 for Firefox

Nov 20th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. bool ExceptionHandler::WriteMinidumpForChild(....)
  2. {
  3.   ...
  4.   DWORD last_suspend_cnt = -1;
  5.   ...
  6.   // this thread may have died already, so not opening
  7.   // the handle is a non-fatal error
  8.   if (NULL != child_thread_handle) {
  9.     if (0 <=
  10.         (last_suspend_cnt = SuspendThread(child_thread_handle)))
  11.     {
  12.   ...
  13. }
  14.  
  15. Most likely this is what should be written here: (((DWORD) -1) != (last_suspend_cnt = SuspendThread(child_thread_handle))).
  16.  
  17.  
  18. This suspicious code was found in Firefox project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V547 Expression is always true. Unsigned type value is always >= 0. exception_handler.cc 846
  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