Skip to content

Conversation

@fglock
Copy link
Owner

@fglock fglock commented Jan 5, 2026

Summary

Fixes pack/unpack regressions and string interpolation bugs.

Changes

  • String Interpolation: Fixed @!, @+, @- arrays incorrectly interpolating in double-quoted strings
  • Pack Numeric Overloading: Fixed pack('c') to use numeric overload (0+) instead of string overload ("")
  • Pack @! Byte Positioning: Fixed pack/unpack @! to use byte-based positioning for UTF-8 strings
  • Pack Template Parsing: Improved parsing for modifiers with counts (e.g., @!2, c!4)
  • XS::APItest Module: Added module for pack pointer tests (modify_pv)
  • Control Flow Test: Added test validating last SKIP behavior across call frames
  • Cleanup: Removed duplicate JAR_PATH check in jperl launcher

Testing

  • "@!2" now correctly outputs @!2 instead of 2
  • pack('c', $overloaded_obj) triggers numeric overload
  • pack('@!2') and unpack('@!4') work correctly with UTF-8
  • All tests in skip_control_flow.t pass

fglock added 8 commits January 5, 2026 16:05
- Fix string interpolation: @!, @+, @- arrays do not interpolate in double-quoted strings
- Fix pack('c') to use numeric overload (0+) instead of string overload ("")
- Fix pack/unpack @! to use byte-based positioning for UTF-8 strings
- Improve pack template parsing for modifiers with counts (e.g., @!2, c!4)
- Remove duplicate JAR_PATH check in jperl launcher script

These changes fix regressions in op/pack.t and ensure correct behavior
for pack format modifiers, numeric overloading, and UTF-8 byte alignment.
- Add XS::APItest Java module providing modify_pv for pack pointer tests
- Add XS::APItest Perl module loader
- Add skip_control_flow.t test validating last SKIP behavior across call frames
- Add pushGroupStart/popGroupStart/getGroupStart for group tracking
- Add byteOffsetOfIndex/moveToBytePosition/moveToIndex for positioning
- Add byteSize for byte-based size calculation
- Add modifyPointer to PointerPackHandler for XS::APItest support

These methods are required by the pack/unpack @! byte-alignment fixes.
This test is for control flow features, not pack/unpack fixes.
Test #2 is failing in current master, so removing from this PR.
… of this PR

The test fails because last SKIP doesn't propagate through scalar context
function calls. This is a known limitation in master that requires complex
bytecode changes that cause ASM verification errors. Removing from this PR
as it's not related to pack/unpack or string interpolation fixes.
The test documents a known limitation in master where last SKIP doesn't
propagate through scalar context function calls. Fixing this requires
complex bytecode changes that cause ASM verification errors.

This is not related to the pack/unpack and string interpolation fixes
in this PR, so removing it to keep the PR focused.
@fglock
Copy link
Owner Author

fglock commented Jan 5, 2026

Closing to focus on control flow fix separately

@fglock fglock closed this Jan 5, 2026
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.

2 participants