This revision was automatically updated to reflect the committed changes.
Closed by commit rL323146: [analyzer] Protect against dereferencing a null 
pointer (authored by alexshap, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D42388?vs=130935&id=130946#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D42388

Files:
  cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp


Index: cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -1185,6 +1185,9 @@
 StackHintGenerator::~StackHintGenerator() {}
 
 std::string StackHintGeneratorForSymbol::getMessage(const ExplodedNode *N){
+  if (!N)
+    return getMessageForSymbolNotFound();
+
   ProgramPoint P = N->getLocation();
   CallExitEnd CExit = P.castAs<CallExitEnd>();
 
@@ -1194,9 +1197,6 @@
   if (!CE)
     return "";
 
-  if (!N)
-    return getMessageForSymbolNotFound();
-
   // Check if one of the parameters are set to the interesting symbol.
   unsigned ArgIndex = 0;
   for (CallExpr::const_arg_iterator I = CE->arg_begin(),


Index: cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -1185,6 +1185,9 @@
 StackHintGenerator::~StackHintGenerator() {}
 
 std::string StackHintGeneratorForSymbol::getMessage(const ExplodedNode *N){
+  if (!N)
+    return getMessageForSymbolNotFound();
+
   ProgramPoint P = N->getLocation();
   CallExitEnd CExit = P.castAs<CallExitEnd>();
 
@@ -1194,9 +1197,6 @@
   if (!CE)
     return "";
 
-  if (!N)
-    return getMessageForSymbolNotFound();
-
   // Check if one of the parameters are set to the interesting symbol.
   unsigned ArgIndex = 0;
   for (CallExpr::const_arg_iterator I = CE->arg_begin(),
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D42388: [an... Alexander Shaposhnikov via Phabricator via cfe-commits
    • [PATCH] D42388... Artem Dergachev via Phabricator via cfe-commits
    • [PATCH] D42388... Alexander Shaposhnikov via Phabricator via cfe-commits
    • [PATCH] D42388... Alexander Shaposhnikov via Phabricator via cfe-commits

Reply via email to