Crash Hotfix.

This commit is contained in:
Chao Shen 2018-01-18 18:59:51 +08:00 committed by Jacob Dufault
parent ae26aa93db
commit 405fd56781

View File

@ -422,7 +422,7 @@ void SetVarDetail(IndexVar* var,
? param->ns.QualifiedName(semanticContainer, def.short_name) ? param->ns.QualifiedName(semanticContainer, def.short_name)
: def.short_name; : def.short_name;
if (cursor.get_kind() == CXCursor_EnumConstantDecl) { if (cursor.get_kind() == CXCursor_EnumConstantDecl && semanticContainer) {
CXType enum_type = clang_getEnumDeclIntegerType(semanticContainer->cursor); CXType enum_type = clang_getEnumDeclIntegerType(semanticContainer->cursor);
std::string hover = qualified_name + " = "; std::string hover = qualified_name + " = ";
if (enum_type.kind == CXType_Int || enum_type.kind == CXType_Long || if (enum_type.kind == CXType_Int || enum_type.kind == CXType_Long ||