Review Request 126854: Prevent crash when destroying Parser for ruby file with inrecoverable errors

Milian Wolff mail at milianw.de
Sat Jan 23 21:26:14 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126854/#review91494
-----------------------------------------------------------


Ship it!




Ship It!

- Milian Wolff


On Jan. 23, 2016, 6:05 p.m., Daniel Vrátil wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126854/
> -----------------------------------------------------------
> 
> (Updated Jan. 23, 2016, 6:05 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-ruby
> 
> 
> Description
> -------
> 
> When `rb_compile_file()` in `Parser` fails to build the AST for a file (e.g. due to wrong syntax), `Parser::parse()` aborts and return a nullptr, but the `ast` member variable remains initialized to an invalid pointer (from `ast_t::tree`). When the `Parser` is destroyed later, it hits SIGSEGV, because `free_ast` tries to free an invalid pointer.
> 
> 
> Diffs
> -----
> 
>   parser/parser.cpp 67e35d9 
> 
> Diff: https://git.reviewboard.kde.org/r/126854/diff/
> 
> 
> Testing
> -------
> 
> No more crashes when opening an invalid Ruby file.
> 
> 
> Thanks,
> 
> Daniel Vrátil
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160123/8cdbcde5/attachment.html>


More information about the KDevelop-devel mailing list