Commit 5a0195e1 authored by Ole Christian Eidheim's avatar Ole Christian Eidheim
Browse files

Fixed errorenous iterator usage in clangmm::Tokens::Tokens

parent 2ae7b5db
......@@ -63,14 +63,16 @@ clangmm::Tokens::Tokens(CXTranslationUnit &cx_tu, const SourceRange &range, bool
if(clang_getCursorKind(cx_cursor)==CXCursor_FieldDecl) {
Cursor cursor(cx_cursor);
auto clang_offset=cursor.get_source_location().get_offset();
for(auto it=data->invalid_tokens.begin();it!=data->invalid_tokens.end();++it) {
for(auto it=data->invalid_tokens.begin();it!=data->invalid_tokens.end();) {
if(it->second==clang_offset) {
(*data->tokens)[it->first].cx_cursor=cursor.cx_cursor;
data->invalid_tokens.erase(it);
it=data->invalid_tokens.erase(it);
if(data->invalid_tokens.empty())
return CXChildVisit_Break;
break;
}
else
++it;
}
}
return CXChildVisit_Recurse;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment