<div dir="ltr">Can you please open a new bug at <a href="https://llvm.org/bugs/">https://llvm.org/bugs/</a>. Providing a standalone minimal example that demonstrates the problem will generally speed things up.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 9, 2015 at 7:34 PM, palparni <span dir="ltr"><<a href="mailto:palparni@gmail.com" target="_blank">palparni@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
I found that CursorVisitor::VisitChildren() does not properly honor the<br>
user's request to break the visiting by returning CXChildVisit_Break from<br>
the visitor callback. This can be a problem in certain scenarios, like when<br>
there is an out of memory error and the user wants to abort the visiting<br>
immediately.<br>
<br>
The block of code causing the problem seems to be the following:<br>
// Walk the preprocessing record.<br>
if (CXXUnit->getPreprocessor().getPreprocessingRecord())<br>
  visitPreprocessedEntitiesInRegion();<br>
<br>
which as far as I can tell needs to be changed based on how other visiting<br>
calls are made (to stop the 'for' loop):<br>
if (CXXUnit->getPreprocessor().getPreprocessingRecord())<br>
  if (visitPreprocessedEntitiesInRegion())<br>
    return true;<br>
<br>
Thank you,<br>
Alpar<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Libclang-visitChildren-does-not-properly-handle-aborting-the-visit-tp4044893.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Libclang-visitChildren-does-not-properly-handle-aborting-the-visit-tp4044893.html</a><br>
Sent from the Clang Developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>