Fix crash in ClangCursor::get_arguments

This commit is contained in:
Jacob Dufault 2018-02-13 10:21:10 -08:00
parent 72e654ffed
commit aae6f456de

View File

@ -94,6 +94,8 @@ ClangType ClangType::get_return_type() const {
std::vector<ClangType> ClangType::get_arguments() const {
int size = clang_getNumArgTypes(cx_type);
if (size < 0)
return {};
std::vector<ClangType> types(size);
for (int i = 0; i < size; ++i)
types.emplace_back(clang_getArgType(cx_type, i));