Fix CIndex crash on invalid code reported in <rdar://problem/7833619>.

llvm-svn: 100589
This commit is contained in:
Ted Kremenek 2010-04-07 00:27:13 +00:00
parent ea7a133775
commit 6ca136a77f
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,4 @@
// RUN: c-index-test -test-load-source all %s
// All we care about in this test is that it doesn't crash.
typedef r7833619_a (*r7833619_b)(r7833619_c *r7833619_d, r7833619_c *r7833619_e);

View File

@ -814,8 +814,9 @@ bool CursorVisitor::VisitFunctionTypeLoc(FunctionTypeLoc TL) {
return true;
for (unsigned I = 0, N = TL.getNumArgs(); I != N; ++I)
if (Visit(MakeCXCursor(TL.getArg(I), TU)))
return true;
if (Decl *D = TL.getArg(I))
if (Visit(MakeCXCursor(D, TU)))
return true;
return false;
}