PVS-StudioWarnings

PVS-Studio warning V595 for Clang

Nov 20th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. void ProfileEstimatorPass::recurseBasicBlock(BasicBlock *BB) {
  2.   ...
  3.   Loop* BBLoop = LI->getLoopFor(BB);
  4.   ...
  5.   if (BBisHeader && BBLoop->contains(*bbi)) {
  6.     ...
  7.   }
  8.   ...
  9.   if (BBLoop) {
  10.     BBLoop->getExitEdges(ExitEdges);
  11.   }
  12.   ...
  13. }
  14.  
  15. This suspicious code was found in Clang project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V595 The 'BBLoop' pointer was utilized before it was verified against nullptr. Check lines: 142, 160. LLVMAnalysis profileestimatorpass.cpp 142
  18.  
  19. 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