[ruby-core:127285] [Ruby Bug#20269] bignum too big to convert into `long' when running String#byteslice on Windows
Issue #20269 has been updated by hsbt (Hiroshi SHIBATA). This still happens on mingw, where lengths are still limited to 32 bits. I plan to make them 64 bits there too, as on mswin, which should fix it. ---------------------------------------- Bug #20269: bignum too big to convert into `long' when running String#byteslice on Windows https://bugs.ruby-lang.org/issues/20269#change-119710 * Author: Anonymous * Status: Open * Assignee: windows * ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x64-mingw-ucrt] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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] ``` -- https://bugs.ruby-lang.org/
participants (1)
-
hsbt (Hiroshi SHIBATA)