mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 18:00:26 +00:00
Fix crash in ClangCursor::get_arguments
This commit is contained in:
parent
72e654ffed
commit
aae6f456de
@ -94,6 +94,8 @@ ClangType ClangType::get_return_type() const {
|
|||||||
|
|
||||||
std::vector<ClangType> ClangType::get_arguments() const {
|
std::vector<ClangType> ClangType::get_arguments() const {
|
||||||
int size = clang_getNumArgTypes(cx_type);
|
int size = clang_getNumArgTypes(cx_type);
|
||||||
|
if (size < 0)
|
||||||
|
return {};
|
||||||
std::vector<ClangType> types(size);
|
std::vector<ClangType> types(size);
|
||||||
for (int i = 0; i < size; ++i)
|
for (int i = 0; i < size; ++i)
|
||||||
types.emplace_back(clang_getArgType(cx_type, i));
|
types.emplace_back(clang_getArgType(cx_type, i));
|
||||||
|
Loading…
Reference in New Issue
Block a user