Actions
Bug #20269
open![Author: Anonymous](/images/anonymous.png?1722288379)
bignum too big to convert into `long' when running String#byteslice on Windows
Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x64-mingw-ucrt]
Description
Running String#byteslice
on Ruby 3.3 on Windows results in an error when using any number bigger than 32 bits:
"".byteslice(0, 2547483647)
(irb):1:in `byteslice': bignum too big to convert into `long' (RangeError)
from (irb):1:in `<main>'
from <internal:kernel>:187:in `loop'
from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/irb-1.11.0/exe/irb:9:in `<top (required)>'
from C:/Ruby33-x64/bin/irb:33:in `load'
from C:/Ruby33-x64/bin/irb:33:in `<main>'
It works fine on MacOS:
irb(main):001> "".byteslice(0, 2547483647)
=> ""
irb(main):002> exit
Andys-MBP:project apf$ ruby -v
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin23]
Actions
Like0
Like0Like0