From: shyouhei@... Date: 2019-01-11T14:33:36+00:00 Subject: [ruby-core:91023] [Ruby trunk Bug#15460][Assigned] Behaviour of String#setbyte changed Issue #15460 has been updated by shyouhei (Shyouhei Urabe). Status changed from Open to Assigned Assignee set to shyouhei (Shyouhei Urabe) I had a chance this week to ask matz if he wants to allow bigger inputs or not for those methods. He answered yes. He prefers mod 256 behaviour for larger numbers. I will fix them again. ---------------------------------------- Bug #15460: Behaviour of String#setbyte changed https://bugs.ruby-lang.org/issues/15460#change-76247 * Author: gettalong (Thomas Leitner) * Status: Assigned * Priority: Normal * Assignee: shyouhei (Shyouhei Urabe) * Target version: * ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] * Backport: 2.4: DONTNEED, 2.5: DONTNEED, 2.6: REQUIRED ---------------------------------------- I just installed Ruby 2.6.0 for benchmarking reasons and found that the change [string.c: setbyte silently ignores upper bits](https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/65804) broke my library/application HexaPDF. Before using String#setbyte I tested how it would respond to values lower than 0 or greater than 255 and found that it automatically performed the needed modulo 256 operation (at least up to Ruby 2.5.3). Therefore I left out the explicit modulo operation for performance reasons. Would it make sense to change the String#setbyte implementation to perform the modulo operation? This would restore compatibility with prior Ruby versions and may be what people would expect. -- https://bugs.ruby-lang.org/ Unsubscribe: