From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 21A31211B9 for ; Tue, 25 Dec 2018 10:22:49 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C9A9F120E33; Tue, 25 Dec 2018 19:22:45 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id D033F120AE9 for ; Tue, 25 Dec 2018 19:22:42 +0900 (JST) Received: by filter0142p3las1.sendgrid.net with SMTP id filter0142p3las1-28879-5C2204EF-1B 2018-12-25 10:22:39.477040992 +0000 UTC m=+388463.167548474 Received: from herokuapp.com (ec2-54-157-231-247.compute-1.amazonaws.com [54.157.231.247]) by ismtpd0014p1iad2.sendgrid.net (SG) with ESMTP id rerSXhW_Q5Gop1SN-KJctA for ; Tue, 25 Dec 2018 10:22:39.311 +0000 (UTC) Date: Tue, 25 Dec 2018 10:22:40 +0000 (UTC) From: t_leitner@gmx.at To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66118 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15460 X-Redmine-Issue-Author: gettalong X-Redmine-Sender: gettalong X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS7XIEb3as70lWM9r6Bu0IpakHKSUx8KOqBGd4 qb/Pi+Hk3+z9HfbBBDnFIh8AMUm8aL479KhL8FDjxQGaNNfA1w7Ek3/8vwm+nHigLzI3ZiwmZ4irDh y+H28TaVK0pvZ0i5RRNqJG8HtWIdnieiJBI+Q+N1AqBL6E42IuEYxpEnSw== X-ML-Name: ruby-core X-Mail-Count: 90700 Subject: [ruby-core:90700] [Ruby trunk Bug#15460] Behaviour of String#setbyte changed X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15460 has been reported by gettalong (Thomas Leitner). ---------------------------------------- Bug #15460: Behaviour of String#setbyte changed https://bugs.ruby-lang.org/issues/15460 * Author: gettalong (Thomas Leitner) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- 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/