Skip to content

Fix associate() handling of #include from symlink #131

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

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

Pennycook
Copy link
Contributor

Related issues

Fixes a bug inadvertently introduced by #125, which I found in offline stress-testing.

Proposed changes

  • Add a regression test for the problematic case.
  • Fix the bug in associate() by ensuring we call realpath before passing filenames to evaluate_for_platform.

Replacing TreeAssociator with a function introduced a bug in the corner case
when an #include directive is encountered inside of a symlink.

Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook added the bug Something isn't working label Nov 27, 2024
The information stored within a ParserState is tied to a file's real path, not
its absolute path. We need to call realpath() before passing a filename to
evaluate_for_platform() to ensure that it can be used for indexing.

Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook added this to the 2.0.0 milestone Nov 27, 2024
@Pennycook Pennycook merged commit daf5de1 into intel:main Dec 12, 2024
3 checks passed
@Pennycook Pennycook deleted the associate-fix branch December 12, 2024 10:50
@Pennycook Pennycook mentioned this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants