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 finding Resource Dir #171

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

anutosh491
Copy link
Collaborator

Description

std::find operates based on the operator== of the type being compared. For const char*, the operator== compares the memory addresses (the pointer values), not the contents of the strings.

Hence although we should fetch resource dir from the kernel.json file, we end up entering the block checking for resource dir and trying getting it through CppInterOp. This should not be the case.

Type of change

Please tick all options which are relevant.

  • Bug fix
  • New feature
  • Added/removed dependencies
  • Required documentation updates

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.78%. Comparing base (a0f92be) to head (0bca94e).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   80.76%   80.78%   +0.01%     
==========================================
  Files          19       19              
  Lines         972      973       +1     
  Branches       93       93              
==========================================
+ Hits          785      786       +1     
  Misses        187      187              
Files with missing lines Coverage Δ
src/xinterpreter.cpp 91.35% <100.00%> (+0.04%) ⬆️
Files with missing lines Coverage Δ
src/xinterpreter.cpp 91.35% <100.00%> (+0.04%) ⬆️

Copy link
Contributor

github-actions bot commented Nov 8, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

There is nothing wrong with the current approach: https://godbolt.org/z/5GzTeYo93 I do not think this needs fixing. Consider closing this PR.

Copy link
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

I think I see what you mean, because we have an std::vector<const char*> we can't really use the operator== of std::string. Apologies for the oversight.

src/xinterpreter.cpp Outdated Show resolved Hide resolved
Co-authored-by: Vassil Vassilev <[email protected]>
src/xinterpreter.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/xinterpreter.cpp Outdated Show resolved Hide resolved
Co-authored-by: Vassil Vassilev <[email protected]>
Copy link
Contributor

github-actions bot commented Nov 8, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

Lgtm!

@vgvassilev vgvassilev merged commit d4b7813 into compiler-research:main Nov 8, 2024
9 of 10 checks passed
@anutosh491 anutosh491 deleted the fix_resource_dir branch November 10, 2024 08:25
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.

3 participants