Skip to content

Apply the unpack offset only once - #10151

Merged
headius merged 1 commit into
jruby:ruby-4.1from
sferik:unpack-offset
Dec 1, 2026
Merged

headius merged 1 commit into
jruby:ruby-4.1from
sferik:unpack-offset

Conversation

@sferik

@sferik sferik commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #10150.

The merge of master into ruby-4.1 in 7e87409 brought back the old offset checks in Pack.unpackInternal, above the ones from #10035. With both, the offset was added to the start of the string twice, and a negative offset raised offset can't be negative again. This removes the old checks, so the code is what #10035 merged.

The 14 failing examples in spec/ruby/core/string/unpack_spec.rb, unpack1_spec.rb and spec/ruby/core/string/unpack pass now, in the interpreter and with -Xjit.threshold=0. So do spec/ruby/core/array/pack and test/mri/ruby/test_pack.rb.

The merge of master into ruby-4.1 in 7e87409 brought back the old
offset checks in Pack.unpackInternal above the ones from
jruby#10035, so the offset was added to
the start twice and a negative offset raised again. Remove the old
checks.

Fixes jruby#10150
@sferik sferik changed the title Apply the unpack offset once again Apply the unpack offset only once Nov 22, 2026
@headius headius added this to the JRuby 10.2.0.0 milestone Nov 23, 2026
@headius
headius merged commit 37330b2 into jruby:ruby-4.1 Dec 1, 2026
128 of 149 checks passed
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