[cfe-commits] r100589 - in /cfe/trunk: test/Index/invalid-code-rdar_7833619.m tools/CIndex/CIndex.cpp
Ted Kremenek
kremenek at apple.com
Tue Apr 6 17:27:13 PDT 2010
Author: kremenek
Date: Tue Apr 6 19:27:13 2010
New Revision: 100589
URL: http://llvm.org/viewvc/llvm-project?rev=100589&view=rev
Log:
Fix CIndex crash on invalid code reported in <rdar://problem/7833619>.
Added:
cfe/trunk/test/Index/invalid-code-rdar_7833619.m
Modified:
cfe/trunk/tools/CIndex/CIndex.cpp
Added: cfe/trunk/test/Index/invalid-code-rdar_7833619.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/invalid-code-rdar_7833619.m?rev=100589&view=auto
==============================================================================
--- cfe/trunk/test/Index/invalid-code-rdar_7833619.m (added)
+++ cfe/trunk/test/Index/invalid-code-rdar_7833619.m Tue Apr 6 19:27:13 2010
@@ -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);
+
Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=100589&r1=100588&r2=100589&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Tue Apr 6 19:27:13 2010
@@ -814,8 +814,9 @@
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;
}
More information about the cfe-commits
mailing list