Review Request: Fix sporadic crash when parsing files

Milian Wolff mail at milianw.de
Fri Oct 26 01:13:00 UTC 2012


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

Ship it!


That code doesn't make any sense, a const& to a shared pointer should only be used when you e.g. loop over stuff but not to reference something potentially temporary. The whole shared pointer logic would breaks then and I wouldn't be suprised if that could lead to problems.

Even if this doesn't fix the crash, I'm still for committing this.

- Milian Wolff


On Oct. 25, 2012, 7:20 p.m., Maciej Cencora wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107035/
> -----------------------------------------------------------
> 
> (Updated Oct. 25, 2012, 7:20 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Description
> -------
> 
> Sometimes we pass a reference to temporary variable (i.e. AbstractType::Ptr() ) as _dataType param to DeclarationChecker constructor.
> It is later used in operator() member function, while this temp variable does not exist anymore resulting in SIGSEGV.
> Fix this by storing copy of dataType instead of const ref inside DeclarationChecker.
> 
> 
> Diffs
> -----
> 
>   language/duchain/topducontextutils.h 349ba50 
> 
> Diff: http://git.reviewboard.kde.org/r/107035/diff/
> 
> 
> Testing
> -------
> 
> None. How do I run all UTs for kdevplatform?
> 
> Update:
> Unit test run, result the same as without a patch.
> 
> I could try writing an UT, but I'd need some help.
> What should be unit tested here? The TestPtr class that it doesn't store a ref but makes a copy?
> 
> 
> Thanks,
> 
> Maciej Cencora
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20121026/9e42177d/attachment.html>


More information about the KDevelop-devel mailing list