Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #12251 internalError while cppcheck tries to parse Clang AST #5755

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

chrchr-github
Copy link
Collaborator

No description provided.

@@ -509,7 +509,7 @@ void clangimport::AstNode::setLocations(TokenList *tokenList, int file, int line
} else if (ext[0] == '<') {
const std::string::size_type colon = ext.find(':');
if (colon != std::string::npos) {
const bool windowsPath = colon == 2 && ext.size() > 4 && ext[3] == '\\';
const bool windowsPath = colon == 2 && ext.size() > 3 && ext[2] == ':';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some logic for this already exists in Path::isAbsolute() and maybe other places as well. We could put this in a helper function later on and share the code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think that would work, since we are already inside a larger string here. We only need to know if there is a second colon.

@firewave firewave merged commit 2c54f31 into danmar:main Dec 12, 2023
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants