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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1EF341F4CC for ; Mon, 6 Jan 2025 00:57:12 +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=QjuFilk6; 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=Mc27sR5g; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1736125030; bh=3R59hUtJGHREy7pZGO+OhV2PJSJaIq8jHP0qSIFoxXM=; 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=QjuFilk63syujVI/uLNi6e1iHcBVJ4v1AZGEKjfbXOqM8lHxfitRl5pKrS6/lerWV StSUTKSeTm53jwaaj4jqhGIW4bH6r/3wvO+IQVhpGcSUF55VnFJS/u5K89hnwCIoSx rEGu3amPbnkQlD1z6YF142ZKuX9GQWAeXVZOyxNg= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 2FF7B465E1 for ; Mon, 6 Jan 2025 00:57:10 +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=Mc27sR5g; 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 E44EC46590 for ; Mon, 6 Jan 2025 00:57:03 +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=rL9BQZjJkb2SiCLrmI4priAA1LpPwZ3ygQ+k6C/uhSg=; b=Mc27sR5glG8f2ymGk/yGrx2Qnnp1ZYnGdWGE+t8WHroA5yKmdBmWrx+t4lTkoH/twQOz AkRDw0TrqjVRsC3hy7n8hYolTvXzIHYePBHPqTzqLXg9NyrOheyN+Z/jQ31Mf+rmamZSpI lplnUWfO1rva18TtCvdUVJ9bNygQ9A+YqhZou8nnYAWr9S7wA9DsOtSTYqr1qhfo2Y2lkZ kEXF0+5T/ordZ5aUwS7Cd4W6y0zsHuQEC5nrz/ReQE/2//7Cww2K4yVPn3h6PaD4EX8xm6 1Sxba+zmFFcZWzXfFMPXb9XlhRhvxW2PHLupcOIfqJqadX5yNT58CHjfBmX22Cnw== Received: by recvd-786d47b7ff-tsp86 with SMTP id recvd-786d47b7ff-tsp86-1-677B2A5E-4 2025-01-06 00:57:02.862257252 +0000 UTC m=+4505631.185766314 Received: from herokuapp.com (unknown) by geopod-ismtpd-17 (SG) with ESMTP id Hz3JVh6wQBKwRn5Bxe6c7g for ; Mon, 06 Jan 2025 00:57:02.841 +0000 (UTC) Date: Mon, 06 Jan 2025 00:57:02 +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-Assignee: Group (prism) X-Redmine-Issue-Priority: Normal X-Redmine-Sender: kddnewton 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: 97167 X-SG-EID: =?us-ascii?Q?u001=2E41nWPij=2FD1kdGmpgWeHScbb9X8tZePZrQQx3bl8Vy2odBuMhLMhId2kIq?= =?us-ascii?Q?I4MmMJ43lNHfKPNNds=2Fb3JsTYpYoWyQb3+sPV4d?= =?us-ascii?Q?vscaSKwkBzURp9YSQ2z7jz=2FWVQNGly1BgKMvcN0?= =?us-ascii?Q?8z8d39l4ygZv9cY59hvl2IAyv=2F1YWyFrJJiT8s+?= =?us-ascii?Q?Z0x3f7oEUwnNNALCpSnn1=2FDAZYXY=2Fm9aOBDdJcS?= =?us-ascii?Q?1ko5l5kTPU=2FJM+UjslNPsCSyU1lCmj1+geZWwGB?= =?us-ascii?Q?D3mR3i7Y+17aFrRGP=2FQa3lR+HQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: XVTI5743WLRPLMZYJCAXGL6AYEJ6AKPQ X-Message-ID-Hash: XVTI5743WLRPLMZYJCAXGL6AYEJ6AKPQ 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:120491] [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: "kddnewton (Kevin Newton) via ruby-core" Cc: "kddnewton (Kevin Newton)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21001 has been updated by kddnewton (Kevin Newton). Assignee set to prism ---------------------------------------- Bug #21001: unexpected nil result from proc with ensure and next https://bugs.ruby-lang.org/issues/21001#change-111275 * Author: aharpervc (Andrew Harper) * Status: Open * Assignee: prism * 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/