Author: kremenek
Date: Tue Feb 22 22:54:51 2011
New Revision: 126304

URL: http://llvm.org/viewvc/llvm-project?rev=126304&view=rev
Log:
Add null check in CursorVisitor::RunVisitorWorkList() when visiting LabelDecls. 
 Fixes <rdar://problem/9040579>.

Modified:
    cfe/trunk/tools/libclang/CIndex.cpp

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=126304&r1=126303&r2=126304&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Tue Feb 22 22:54:51 2011
@@ -1983,10 +1983,12 @@
       }
       case VisitorJob::LabelRefVisitKind: {
         LabelDecl *LS = cast<LabelRefVisit>(&LI)->get();
-        if (Visit(MakeCursorLabelRef(LS->getStmt(),
-                                     cast<LabelRefVisit>(&LI)->getLoc(),
-                                     TU)))
-          return true;
+        if (LabelStmt *stmt = LS->getStmt()) {
+          if (Visit(MakeCursorLabelRef(stmt, 
cast<LabelRefVisit>(&LI)->getLoc(),
+                                       TU))) {
+            return true;
+          }
+        }
         continue;
       }
       case VisitorJob::NestedNameSpecifierVisitKind: {


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to