From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 29A371F4CC for ; Fri, 3 Jan 2025 20:10:53 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=bPdPQ9jX; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=CC0Y1jLD; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1735935021; bh=pQECpjZ3R6q5U1rG79GzL3POXad2dh8vE+nhYALiV2M=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=bPdPQ9jXbURdevykXsOg8+GZl3LRSqrJ3Y6hS4GTmhU+mvOn9lViaqroBjSl49bMc vaBuMOva2WsADUg4InZywY8AIxlRFZAkrO+m/hKS8S4nSroEG3vSjm6mlWSGgVvZO0 gnUG6ZvSjsIMWRujz0tzquUuKElbhhDNHg3avdCw= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 61E35464D7 for ; Fri, 3 Jan 2025 20:10:21 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=CC0Y1jLD; dkim-atps=neutral Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 78C5946446 for ; Fri, 3 Jan 2025 20:10:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=nSIxnA4VeToQS3kPAYubFjwuf1SzjYHu6ZhyQZ5Yuoo=; b=CC0Y1jLDLyY0Ns37qMTa/6vDXUjezud6VWrFMlpQETU6u5uH8HhowOHPDgzuqgIsb8sw TiUCdNkxHK59NsRrkdGLDn7ZH7JP6fVdDKaFz5uWayCli/fXbJ9WN8sOMzWPcTpYlygVfr 2FAtC55Yj/16q2EuY+jbSWoghsoUjlEFcG/ZJK1bc6rhdOqlhYhraoMMPoEEKYQxhzkafI 0xqYpn9iIgRlYUwrN+vhpQ7pferIn9pRdk+3cdmbfvOn4m+iFOWQeboIwGC3cXPKZC3BZ0 6KZBU4vCx5G3hjnHAKvf9ZeAlKC7KVVDEPz5s49DutVA60pGtBi6LIF/PggE80Jw== Received: by recvd-84b546689d-zrqq5 with SMTP id recvd-84b546689d-zrqq5-1-67784427-2 2025-01-03 20:10:15.133663692 +0000 UTC m=+4315626.880538050 Received: from herokuapp.com (unknown) by geopod-ismtpd-19 (SG) with ESMTP id i6x8STcXSwC2Xf5mFCsbiw for ; Fri, 03 Jan 2025 20:10:15.029 +0000 (UTC) Date: Fri, 03 Jan 2025 20:10:15 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 21001 X-Redmine-Issue-Author: aharpervc X-Redmine-Issue-Priority: Normal X-Redmine-Sender: aharpervc 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-Redmine-MailingListIntegration-Message-Ids: 97148 X-SG-EID: =?us-ascii?Q?u001=2Evio4Mjcx9Q6BOzqlBaE3ua8WJaPDXynk0jOhv45EiKkpkewccFcOEeSz2?= =?us-ascii?Q?STrwFKb2y+G1wfNoV6DXej0JQcAvB9NtaTazQIM?= =?us-ascii?Q?8lwLIlOU9UeEbm2oVTsyiZ=2FiM4ln0cEq=2FdCKfqb?= =?us-ascii?Q?S5oz2MqVbW4QV6upzfbZ9BYdpQVvEHlJTfTlYCs?= =?us-ascii?Q?yAH0d3V2qsW0nDB9Hb87jqamR4EbUd=2FBWIgK90s?= =?us-ascii?Q?GJrCy=2Fqb5Ooac5gaA1Q0bdGKhUstOAOUB7vWp=2Fu?= =?us-ascii?Q?AianGL6Tekyfo+=2F+CoDxllPIrw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: O72WUP46KSOOMX2L7MR4MEUPK2XHPVAI X-Message-ID-Hash: O72WUP46KSOOMX2L7MR4MEUPK2XHPVAI X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:120472] [Ruby master Bug#21001] unexpected nil result from proc with ensure and next List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "aharpervc (Andrew Harper) via ruby-core" Cc: "aharpervc (Andrew Harper)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21001 has been reported by aharpervc (Andrew Harper). ---------------------------------------- Bug #21001: unexpected nil result from proc with ensure and next https://bugs.ruby-lang.org/issues/21001 * Author: aharpervc (Andrew Harper) * Status: Open * ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Hello, I have noticed a different program behavior in Ruby 3.4 compared to previous versions. This is a simplified example for debugging that returns the expected result in Ruby 3.3 but nil in Ruby 3.4 Here is the example program: ``` ruby puts "Ruby: #{RUBY_VERSION}" # okay all versions # RUN_ARRAY = [1] # fails ruby 3.4 only RUN_ARRAY = [1,2] MAP_PROC = Proc.new do |&blk| block_results = [] RUN_ARRAY.each do |value| block_value = blk.call(value) block_results.push block_value end block_results ensure next block_results end test_fn_results = MAP_PROC.call do |value| break if value > 1 next value end puts test_fn_results.inspect ``` For Ruby 3.3.6 the output is: ``` Ruby: 3.3.6 [1] ``` For Ruby 3.4.1 the output is: ``` Ruby: 3.4.1 nil ``` I am expecting the Ruby 3.3 output even for Ruby 3.4. This appears to be a bug, since the program implementation is unchanged. Perhaps there is a bug in the code that is now only showing up with Ruby 3.4, but that seemed unlikely since it's working as expected in other versions. Thank you -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/