Resolving always-false conditional making some compilers miss for preprocessor checks - #2824
Open
Joldiges wants to merge 1 commit into
Open
Resolving always-false conditional making some compilers miss for preprocessor checks#2824Joldiges wants to merge 1 commit into
Joldiges wants to merge 1 commit into
Conversation
Recognize standard #line directives when collecting included files for preprocessor cache manifests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes preprocessor-cache manifest collection for C/C++ preprocessed output by correctly recognizing standard #line directives (previously the condition was always false due to a slice-length mismatch), which could cause cache misses for some compilers (notably Tasking).
Changes:
- Correct
#linedirective detection inprocess_preprocessed_fileby switching to a proper prefix check (starts_with(b"line ")). - Add a unit test validating that
#linedirectives cause the referenced header to be recorded and hashed inincluded_files.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2824 +/- ##
==========================================
+ Coverage 73.71% 73.74% +0.02%
==========================================
Files 72 72
Lines 37932 37975 +43
==========================================
+ Hits 27963 28006 +43
Misses 9969 9969 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standard
#linedirectives were never recognized while collecting includedfiles for preprocessor-cache manifests because the parser compared four bytes
with the five-byte
lineprefix.The existing line
|| (&slice[1..5] == b"line "))Was comparing 4 bytes against 5 causing this conditional to never hit.
This change was primarily made to fix Tasking Compiler runs.
GitHub copilot was used for the debugging and resolution of this issue.