[cfe-dev] Libclang visitChildren does not properly handle aborting the visit

Nikola Smiljanic popizdeh at gmail.com
Sun May 3 20:38:48 PDT 2015


Can you please open a new bug at https://llvm.org/bugs/. Providing a
standalone minimal example that demonstrates the problem will generally
speed things up.

On Thu, Apr 9, 2015 at 7:34 PM, palparni <palparni at gmail.com> wrote:

> Hi All,
>
> 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
> immediately.
>
> The block of code causing the problem seems to be the following:
> // Walk the preprocessing record.
> if (CXXUnit->getPreprocessor().getPreprocessingRecord())
>   visitPreprocessedEntitiesInRegion();
>
> which as far as I can tell needs to be changed based on how other visiting
> calls are made (to stop the 'for' loop):
> if (CXXUnit->getPreprocessor().getPreprocessingRecord())
>   if (visitPreprocessedEntitiesInRegion())
>     return true;
>
> Thank you,
> Alpar
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/Libclang-visitChildren-does-not-properly-handle-aborting-the-visit-tp4044893.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150504/109f5024/attachment.html>


More information about the cfe-dev mailing list