Skip to content

Improve error handling of CppServiceHandler#566

Merged
intjftw merged 3 commits into
Ericsson:masterfrom
andocz:fix-gettags-segfault
Feb 13, 2023
Merged

Improve error handling of CppServiceHandler#566
intjftw merged 3 commits into
Ericsson:masterfrom
andocz:fix-gettags-segfault

Conversation

@andocz

@andocz andocz commented Mar 7, 2022

Copy link
Copy Markdown
Contributor

Sometimes a segfault happens when opening "This calls" in the info tree. For example at tinyxml2::XMLDocument::SetError.

I fixed this by adding a check against the query matching nothing, like how it's already done with other queries in the code.
The query is empty if the AST node has no corresponding CPP entity. In TinyXML2's case this happens with __va_list_tag::__va_list_tag(). I assume this is an anomaly, so I added a warning log message.

I also updated an extremely outdated comment.

@intjftw intjftw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify according to the C++ coding convention (space between if and parentheses, else goes to new line after bracket), otherwise it's fine.

@intjftw intjftw added Kind: Bug ⚠️ Plugin: C++ Issues related to the parsing and presentation of C++ projects. labels Mar 7, 2022
@intjftw intjftw added this to the Release Gershwin milestone Mar 7, 2022
@bruntib bruntib requested a review from intjftw March 12, 2022 23:39
Comment thread plugins/cpp/service/src/cppservice.cpp Outdated
@andocz andocz changed the title Add .empty() check in CppServiceHandler::getTags Improve error handling of CppServiceHandler Apr 5, 2022
@mcserep

mcserep commented Feb 11, 2023

Copy link
Copy Markdown
Collaborator

@whisperity, @intjftw: Is there any reason this is not merged yet?

Seems like all requested changes have been made and it looks good to me.

@intjftw intjftw merged commit 17e1a10 into Ericsson:master Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kind: Bug ⚠️ Plugin: C++ Issues related to the parsing and presentation of C++ projects.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants