fix: correct bareword check typo $_[9] -> $_[0] in dir functions#191
fix: correct bareword check typo $_[9] -> $_[0] in dir functions#191Koan-Bot wants to merge 1 commit intocpanel:masterfrom
Conversation
atoomic
left a comment
There was a problem hiding this comment.
I've some concerns regarding that change as I think we really wanted to check both 0 and 9
|
Can we have some unit test for this to show how it’s failing without the fix |
Rebase: fix: correct bareword check typo $[9] -> $[0] in dir functionsBranch Actions
Automated by Kōan |
|
That new test added here is failing on ubuntu you can check https://github.com/cpanel/Test-MockFile/actions/runs/21918515981/job/63292227517?pr=191 Let's make sure we fix it properly |
Rebase: fix: correct bareword check typo $[9] -> $[0] in dir functionsBranch Actions
Automated by Kōan |
|
Same failure from smokers: |
b946c5e to
feb15b6
Compare
|
Rebuilt the branch from current master (was conflicting with merged PRs #192-195). Changes in this update:
Single squashed commit (feb15b6), no other files touched. |
feb15b6 to
076238e
Compare
|
CI fix pushed: Changed the test to verify the effect of |
|
@atoomic — Re: your concern about checking both The # __open uses the correct check:
if ( defined $_[0] && !ref $_[0] ) {
( $likely_bareword, @_ ) = _upgrade_barewords(@_);
}These dir functions only accept 1–2 args ( Adding Let me know if that addresses the concern or if you had a different scenario in mind. |
The _upgrade_barewords guard in opendir/readdir/seekdir/rewinddir/telldir/ closedir was checking $_[9] (always undef for 1-2 arg functions) instead of $_[0]. This caused the upgrade path to run unconditionally, even for reference filehandles. Also adjust seekdir test to verify its effect (telldir position) rather than its return value, which is not reliably consistent across Perl versions when using CORE::GLOBAL overrides. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
076238e to
4918e8c
Compare
Summary
__opendir,__readdir,__telldir,__rewinddir,__seekdir, and__closedir$_[9](out-of-bounds index, always undef) instead of$_[0]!ref(undef)is always true,_upgrade_barewordsran unconditionallyTest plan
Split from #189 per maintainer request.
🤖 Generated with Claude Code