Author: wan
Date: Wed Sep  1 18:54:22 2010
New Revision: 112777

URL: http://llvm.org/viewvc/llvm-project?rev=112777&view=rev
Log:
Make RecursiveASTVisitor not crash when a TemplateArgumentLoc object has a NULL 
TypeSourceInfo*.  This fixes the symptom of http://llvm.org/PR8043.  Reviewed 
by csilvers.

Modified:
    cfe/trunk/include/clang/AST/RecursiveASTVisitor.h

Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=112777&r1=112776&r2=112777&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Wed Sep  1 18:54:22 2010
@@ -541,8 +541,11 @@
     return true;
 
   case TemplateArgument::Type: {
-    TypeSourceInfo *TSI = ArgLoc.getTypeSourceInfo();
-    return getDerived().TraverseTypeLoc(TSI->getTypeLoc());
+    // FIXME: how can TSI ever be NULL?
+    if (TypeSourceInfo *TSI = ArgLoc.getTypeSourceInfo())
+      return getDerived().TraverseTypeLoc(TSI->getTypeLoc());
+    else
+      return true;
   }
 
   case TemplateArgument::Template:


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

Reply via email to