Skip to content

fix: handle use vN; (single-component v-string version)#640

Merged
fglock merged 1 commit intomasterfrom
fix/use-single-component-version
Apr 30, 2026
Merged

fix: handle use vN; (single-component v-string version)#640
fglock merged 1 commit intomasterfrom
fix/use-single-component-version

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Apr 30, 2026

Summary

Fix Index 1 out of bounds for length 1 crash when parsing use vN; (single-component v-string version declaration).

Future::Queue-0.52's Build.PL starts with use v5;, which broke ./jcpan -t Future::Queue. StatementParser.parseUseDeclaration did Integer.parseInt(parts[1]) after splitting the normalized version on ., but for a single-component v-string (v5) normalizeVersion returns just "5", so parts[1] threw.

The fix defaults minorVersion to 0 when only one component is present.

Test plan

  • make (full unit test suite passes)
  • ./jcpan -t Future::Queue now passes all 36 tests across 7 test files
  • No regressions on existing version-handling tests

Generated with Devin

`use v5;` (as in Future::Queue's Build.PL) crashed with
`Index 1 out of bounds for length 1` because StatementParser assumed
the normalized version always had at least major.minor parts. For
single-component v-strings normalizeVersion returns just "5", so
parts[1] threw.

Default minor version to 0 when only one component is present.

Verified: `./jcpan -t Future::Queue` now passes (36/36 tests).

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@fglock fglock merged commit 0082c54 into master Apr 30, 2026
2 checks passed
@fglock fglock deleted the fix/use-single-component-version branch April 30, 2026 13:47
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.

1 participant