projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69987d5
)
[libclang] In clang_getCursorType, don't crash if the translation unit is not
author
Argyrios Kyrtzidis
<akyrtzi@gmail.com>
Wed, 16 Jan 2013 17:04:31 +0000
(17:04 +0000)
committer
Argyrios Kyrtzidis
<akyrtzi@gmail.com>
Wed, 16 Jan 2013 17:04:31 +0000
(17:04 +0000)
set on the cursor; return a null type in such a case.
llvm-svn: 172625
clang/tools/libclang/CXType.cpp
patch
|
blob
|
history
diff --git
a/clang/tools/libclang/CXType.cpp
b/clang/tools/libclang/CXType.cpp
index
88c0e51
..
d7751d2
100644
(file)
--- a/
clang/tools/libclang/CXType.cpp
+++ b/
clang/tools/libclang/CXType.cpp
@@
-131,6
+131,9
@@
CXType clang_getCursorType(CXCursor C) {
using namespace cxcursor;
CXTranslationUnit TU = cxcursor::getCursorTU(C);
+ if (!TU)
+ return MakeCXType(QualType(), TU);
+
ASTContext &Context = static_cast<ASTUnit *>(TU->TUData)->getASTContext();
if (clang_isExpression(C.kind)) {
QualType T = cxcursor::getCursorExpr(C)->getType();