diff options
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
| -rw-r--r-- | clang/tools/libclang/CIndex.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 290146fa4dd..538efd7ae38 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -3709,7 +3709,9 @@ CXCursor clang_getCursorReferenced(CXCursor C) { if (clang_isStatement(C.kind)) { Stmt *S = getCursorStmt(C); if (GotoStmt *Goto = dyn_cast_or_null<GotoStmt>(S)) - return MakeCXCursor(Goto->getLabel()->getStmt(), getCursorDecl(C), tu); + if (LabelDecl *label = Goto->getLabel()) + if (LabelStmt *labelS = label->getStmt()) + return MakeCXCursor(labelS, getCursorDecl(C), tu); return clang_getNullCursor(); } |

