From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 44E08543BF5; Thu, 5 Mar 2026 15:09:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 44E08543BF5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1772712551; bh=9y9UKwNR+xW4EP4T/QfkAbCrXZkTxn0VgO9J5Nvzh9M=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=ExzDR/Z3qHmFD4JbeiJiCFfCByc3LVAQkWQWXHWgZWzF+O2jfP+N0dKNCNBY2jxEC 32eL7mghEUfbPCk+Qn8usl6OW3+b9GHwb1wHSf0aT3DH3RWrGEs0HcCw24n88BlSGj nMEavgJWbTe6ar9C6rktjE3RMGsTzmCq3cfnBXXQ= Received: from send149.i.mail.ru (send149.i.mail.ru [89.221.237.244]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C1C2B543BF5 for ; Thu, 5 Mar 2026 15:09:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C1C2B543BF5 Received: by exim-smtp-558f87dcd7-xmgkj with esmtpa (envelope-from ) id 1vy7Vs-00000000TN7-2pLG; Thu, 05 Mar 2026 15:09:09 +0300 Content-Type: multipart/alternative; boundary="------------zC0FczM00PwlT5FoXnHvbNqg" Message-ID: <7cb1512d-5028-47a7-8789-1e0f63deb5d6@tarantool.org> Date: Thu, 5 Mar 2026 15:09:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: <20260302081443.1058-1-skaplun@tarantool.org> <07642828-4ad9-4532-a195-b24afa22963f@tarantool.org> Content-Language: en-US In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9406AA218EDC7AA27B42CEFEB667FFC919782AE9FC69328E1182A05F5380850403BF4E4492DAE48083DE06ABAFEAF67057CF3781B86892C232BD9A721BEB0AD7F0BB68142C3911900 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE742D9BD90C58D50E0EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB553375666F44369204E714C76A6E60951537558FBE23ED67858D0FF8DB844B59A24D1D01389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6957A4DEDD2346B42CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249CB3CB8E9EF962DC476E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8BE270C32E94023BD73AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7356436AE5DD6441DC7C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5AA8A567779E2824C5002B1117B3ED6967AFC6A422ACBEFD9219207EC0A953D2C823CB91A9FED034534781492E4B8EEAD3CCD70CEBBF18A22BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6590444AD9A5FD34036848E04E63966980FE47D1E39845266C3306F3D8F7DF461DB7E6CDC2351697250B8341EE9D5BE9A0AEA8C9D49B32AFA45A9609EDBD2C7535B9E01AD281346A5D38CD93680B12512CF4C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVbwN8XFWZxQUAuguQdO4CM8= X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F2588458142D8255DECE51D805E38EDE555C2806A819FE46D82BB07493A4FAC535FA523A645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] DUALNUM: Add missing type conversion for FORI slots. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------zC0FczM00PwlT5FoXnHvbNqg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey, LGTM On 3/5/26 12:57, Sergey Kaplun wrote: > Hi, Sergey! > Thanks for the review. > See my answer below. > > On 04.03.26, Sergey Bronnikov wrote: >> Hi, Sergey, >> >> thanks for the patch! >> >> The bug cannot be reproduced with reverted fix. >> >> CMake: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DLUAJIT_NUMMODE=2 > You need to enable assertions as well. Yep, with -DLUA_USE_ASSERT=ON it is reproduced. > >> Sergey >> >> On 3/2/26 11:14, Sergey Kaplun wrote: >>> From: Mike Pall >>> >>> Reported by Sergey Kaplun. >>> >>> (cherry picked from commit 406cf69b3ae0a3ecd5ede2bb97b937b7a5d92074) >>> >>> `rec_for_loop()` narrows the FORL index values by getting them from the >>> runtime. In case when the `start`, `stop`, `step` control variables are >>> already loaded to the slots, their TRef isn't converted to the >>> corresponding type. This leads to the following inconsistent IR dump and >>> to the assertion failure later: >>> | 0002 > int SLOAD 10 TCI >>> | 0003 int ADD 0002 +1. >>> | 0004 > int LE 0003 +1. >>> | 0005 int ADD 0003 +1. >>> | 0006 > int GT 0005 +1. >>> >>> This patch adds the missing type conversion. >>> >>> Sergey Kaplun: >>> * added the description and the test for the problem >>> >>> Part of tarantool/tarantool#12134 >>> --- >>> >>> Branch:https://github.com/tarantool/luajit/tree/skaplun/lj-1413-missing-conv-fori >>> Related issues: >>> *https://github.com/LuaJIT/LuaJIT/issues/1413 >>> *https://github.com/tarantool/tarantool/issues/12134 >>> > > --------------zC0FczM00PwlT5FoXnHvbNqg Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey,

LGTM

On 3/5/26 12:57, Sergey Kaplun wrote:
Hi, Sergey!
Thanks for the review.
See my answer below.

On 04.03.26, Sergey Bronnikov wrote:
Hi, Sergey,

thanks for the patch!

The bug cannot be reproduced with reverted fix.

CMake: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DLUAJIT_NUMMODE=2
You need to enable assertions as well.
Yep, with -DLUA_USE_ASSERT=ON it is reproduced.

Sergey

On 3/2/26 11:14, Sergey Kaplun wrote:
From: Mike Pall <mike>

Reported by Sergey Kaplun.

(cherry picked from commit 406cf69b3ae0a3ecd5ede2bb97b937b7a5d92074)

`rec_for_loop()` narrows the FORL index values by getting them from the
runtime. In case when the `start`, `stop`, `step` control variables are
already loaded to the slots, their TRef isn't converted to the
corresponding type. This leads to the following inconsistent IR dump and
to the assertion failure later:
| 0002 > int SLOAD  10   TCI
| 0003   int ADD    0002  +1.
| 0004 > int LE     0003  +1.
| 0005   int ADD    0003  +1.
| 0006 > int GT     0005  +1.

This patch adds the missing type conversion.

Sergey Kaplun:
* added the description and the test for the problem

Part of tarantool/tarantool#12134
---

Branch:https://github.com/tarantool/luajit/tree/skaplun/lj-1413-missing-conv-fori
Related issues:
*https://github.com/LuaJIT/LuaJIT/issues/1413
*https://github.com/tarantool/tarantool/issues/12134

<snipped>

--------------zC0FczM00PwlT5FoXnHvbNqg--