PVS-StudioWarnings

PVS-Studio warning V595 for UnrealEngine4

Nov 12th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. /**
  2.  * Global engine pointer.
  3.  * Can be 0 so don't use without checking.
  4.  */
  5. ENGINE_API UEngine* GEngine = NULL;
  6.  
  7. bool UEngine::LoadMap( FWorldContext& WorldContext,
  8.   FURL URL, class UPendingNetGame* Pending, FString& Error )
  9. {
  10.   ....
  11.   if (GEngine->GameViewport != NULL)
  12.   {
  13.     ClearDebugDisplayProperties();
  14.   }
  15.  
  16.   if( GEngine )
  17.   {
  18.     GEngine->WorldDestroyed( WorldContext.World() );
  19.   }
  20.   ....
  21. }
  22.  
  23. This suspicious code was found in UnrealEngine4 project by PVS-Studio static code analyzer.
  24. Warning message is:
  25. V595 The 'GEngine' pointer was utilized before it was verified against nullptr. Check lines: 9714, 9719. unrealengine.cpp 9714
  26.  
  27. 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