fix: uninitialized value warnings in parsers()#57
Draft
toddr-bot wants to merge 2 commits intoTux:masterfrom
Draft
fix: uninitialized value warnings in parsers()#57toddr-bot wants to merge 2 commits intoTux:masterfrom
toddr-bot wants to merge 2 commits intoTux:masterfrom
Conversation
When a failed `require` produces multi-line error messages in `$@`,
the modified `$p->[0]` (prefixed with "!") was not filtered by the
grep in parsers() because the regex `^(?:dmp|ios|!.*)$` fails when
`.*` cannot match across newlines to reach `$`.
Fix by simplifying the regex to `^(?:dmp|ios|!)` — only the prefix
matters. Also guard the `$can{$typ}` lookup with `// ""` as defense
in depth.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Please make a test that shows these failures. |
All 7 tests pass. Here's a summary of what was added: - **Created `t/12_parsers.t`** per reviewer request to add a test demonstrating the issue Tux#55 failures - Tests that `parsers()` returns results without warnings (catches the `$can{$typ}` undef warning fixed by the `// ""` guard) - Tests that no `!`-prefixed entries (failed modules) leak through the filter - Tests that helper modules (`dmp`, `ios`) are filtered out - Tests SquirrelCalc built-in presence as a sanity check - **Directly demonstrates the bug**: constructs a multiline `$@` string (as occurs on FreeBSD) and shows the old regex `m{^(?:dmp|ios|!.*)$}` fails to match it while the new regex `m{^(?:dmp|ios|!)}` correctly matches — this is the core regression test for issue Tux#55
Author
Rebase: fix: uninitialized value warnings in parsers()Branch Diff: 2 files changed, 55 insertions(+), 2 deletions(-) Review feedback was analyzed and applied. ChangesAll 7 tests pass. Here's a summary of what was added:
Actions
Automated by Kōan |
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.
Summary
Fix "Use of uninitialized value in string eq" warnings in
parsers()that occur when$@from a failedrequirecontains embedded newlines (e.g., on FreeBSD). The grep filter regex^(?:dmp|ios|!.*)$fails to match multiline error strings because.doesn't match newlines, allowing modified parser entries to leak through.Fixes #55
Changes
m{^(?:dmp|ios|!.*)$}tom{^(?:dmp|ios|!)}— only the prefix check matters, and this is immune to newline issues in$@// ""guard on$can{$typ}lookup at line 246 as defense in depthTest plan
$@strings while the new regex handles both single-line and multi-line correctlyparsers()returns correct results without warnings after the fixGenerated by Kōan /fix
Quality Report
Changes: 1 file changed, 2 insertions(+), 2 deletions(-)
Code scan: clean
Tests: failed (297 Failed, 296 tests)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline