Skip to content

Array#new size boundary error not tripping#7666

Merged
enebo merged 2 commits intojruby:masterfrom
enebo:array_new_fix
Feb 17, 2023
Merged

Array#new size boundary error not tripping#7666
enebo merged 2 commits intojruby:masterfrom
enebo:array_new_fix

Conversation

@enebo
Copy link
Member

@enebo enebo commented Feb 17, 2023

When a common method was added to check for max size the call put an int cast on a long which truncated the value to 0 at max_int. Making it a long restores the check.

When a common method was added to check for max size the
call put an int cast on a long which truncated the value
to 0 at max_int.  Making it a long restores the check.
@enebo enebo added this to the JRuby 9.4.2.0 milestone Feb 17, 2023
We do now raise if the array cannot fit into a long but
we do not match the error we raise RangeError vs ArgumentError.
@enebo enebo merged commit 754b1fb into jruby:master Feb 17, 2023
@enebo enebo deleted the array_new_fix branch February 17, 2023 20: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