Review Request 111796: Add a simple recursion counter to setSpecializedFrom

Milian Wolff mail at milianw.de
Tue Jul 30 23:42:29 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111796/#review36848
-----------------------------------------------------------



languages/cpp/cppduchain/templatedeclaration.cpp
<http://git.reviewboard.kde.org/r/111796/#comment27182>

    please use existing code (PushValue from util/) instead:
    
    PushValue recHolder(setSpecializedFromRecursionCounter, setSpecializedFromRecursionCounter+1);



languages/cpp/cppduchain/templatedeclaration.cpp
<http://git.reviewboard.kde.org/r/111796/#comment27183>

    hm I'm not sure whether this works - are you sure that this is guarded by our BKL DUChainLock? If so, add the ENSURE_CAN_READ macro here somewhere.
    
    But I think it might not be locked, esp. when the data is not added to the duchain. Hm not sure though.
    
    If it's not, you'll need a thread-local recursion counter. See ThreadLocalData and its usage in the same file for how to do it. There are already two recursion counters in there.


- Milian Wolff


On July 30, 2013, 6:50 p.m., Andreas Pakulat wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111796/
> -----------------------------------------------------------
> 
> (Updated July 30, 2013, 6:50 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Description
> -------
> 
> Add a simple recursion counter to setSpecializedFrom
> 
> This prevents endless recursions into this function, when copying a template
> specialization and insert the copy directly below the existing function this
> happened. Unfortunately its not clear why that happens or what a better fix
> is, but this does not seem to have any bad side-effects and such a duplicated
> specialization is just an intermediate step anyway.
> 
> I've tried writing a test for this, but it seems just parsing the same code
> is not sufficient to trigger the recursion.
> 
> 
> Diffs
> -----
> 
>   languages/cpp/cppduchain/templatedeclaration.cpp b35ba13a0eacb5157a921cf96fdc22c091f625e1 
> 
> Diff: http://git.reviewboard.kde.org/r/111796/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andreas Pakulat
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20130730/1f8155d9/attachment.html>


More information about the KDevelop-devel mailing list