Denote empty files in stack traces#473
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughError formatting improvements in ChangesError Output Formatting
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/libutil/error.cc`:
- Around line 102-104: The else branch prints an "(empty file)" line but wrongly
dereferences the optional loc.errLineOfCode causing UB; update the formatting in
the else path (the block that writes to out using prefix, errPos.line and
*loc.errLineOfCode) to not dereference loc.errLineOfCode when has_value() is
false—use loc.errLineOfCode.value_or("") or pass an empty placeholder string (or
adjust the fmt call to omit that argument) so the output uses a safe empty
string instead of *loc.errLineOfCode.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
5014f42 to
8404436
Compare
Instead of
error: syntax error, unexpected end of file
at «git+file:///.../nixos?rev=0defd19d32413f757d7273596cd9641cb91af25a&shallow=1&submodules=1»/configuration.nix:1:1:
Nix now shows
error: syntax error, unexpected end of file
at «git+file:///home/eelco/Dev/nix-master/nixos?rev=0defd19d32413f757d7273596cd9641cb91af25a&shallow=1&submodules=1»/configuration.nix:1:1:
1| (empty file)
8404436 to
8a568b3
Compare
Motivation
Instead of
(note the
:followed by nothing at the end of the line), Nix now showsContext
Summary by CodeRabbit