I found that CursorVisitor::VisitChildren() does not properly honor the
user's request to break the visiting by returning CXChildVisit_Break from
the visitor callback. This can be a problem in certain scenarios, like when
there is an out of memory error and the user wants to abort the visiting
The block of code causing the problem seems to be the following:
// Walk the preprocessing record.
which as far as I can tell needs to be changed based on how other visiting
calls are made (to stop the 'for' loop):