Hi,

I have a patch that fixes the crash mentioned in
http://llvm.org/bugs/show_bug.cgi?id=8043.  Can someone please review
it?

You can find the patch either at

http://codereview.appspot.com/2098043

or at the end of this message.  Thanks!

-- 
Zhanyong

Index: lib/AST/TemplateBase.cpp
===================================================================
--- lib/AST/TemplateBase.cpp    (revision 113025)
+++ lib/AST/TemplateBase.cpp    (working copy)
@@ -125,19 +125,22 @@
   switch (Argument.getKind()) {
   case TemplateArgument::Expression:
     return getSourceExpression()->getSourceRange();
-
+
   case TemplateArgument::Declaration:
     return getSourceDeclExpression()->getSourceRange();
-
+
   case TemplateArgument::Type:
-    return getTypeSourceInfo()->getTypeLoc().getSourceRange();
-
+    if (TypeSourceInfo *TSI = getTypeSourceInfo())
+      return TSI->getTypeLoc().getSourceRange();
+    else
+      return SourceRange();
+
   case TemplateArgument::Template:
     if (getTemplateQualifierRange().isValid())
       return SourceRange(getTemplateQualifierRange().getBegin(),
                          getTemplateNameLoc());
     return SourceRange(getTemplateNameLoc());
-
+
   case TemplateArgument::Integral:
   case TemplateArgument::Pack:
   case TemplateArgument::Null:
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to