PVS-StudioWarnings

PVS-Studio warning V522 for Clang

Nov 18th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. void MatcherGen::EmitLeafMatchCode(const TreePatternNode *N) {
  2.   ...
  3.   if (DI == 0) {
  4.     errs() << "Unknown leaf kind: " << *DI << "\n";
  5.     abort();
  6.   }
  7.   ...
  8. }
  9.  
  10. This suspicious code was found in Clang project by PVS-Studio static code analyzer.
  11. Warning message is:
  12. V522 Dereferencing of the null pointer 'DI' might take place. llvm-tblgen dagiselmatchergen.cpp 220
  13.  
  14. 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