PVS-StudioWarnings

PVS-Studio warning V519 for WebKit

Nov 18th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. bool ScriptDebugServer::executeSkipPauseRequest(....)
  2. {
  3.   const char* v8MethodName;
  4.   switch (request)
  5.   {
  6.     case ScriptDebugListener::NoSkip:
  7.       return false;
  8.     case ScriptDebugListener::Continue:
  9.       return true;
  10.     case ScriptDebugListener::StepInto:
  11.       v8MethodName = stepIntoV8MethodName;
  12.     case ScriptDebugListener::StepOut:
  13.       v8MethodName = stepOutV8MethodName;
  14.   }
  15.   v8::Handle<v8::Value> argv[] = { executionState };
  16.   callDebuggerMethod(stepIntoV8MethodName, 1, argv);
  17.   return true;
  18. }
  19.  
  20. This suspicious code was found in WebKit project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V519 The 'v8MethodName' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 412, 414. ScriptDebugServer.cpp 414
  23.  
  24. 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