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 57CFF64BB41; Tue, 10 Mar 2026 10:29:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 57CFF64BB41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1773127749; bh=QMcS8jdxMuQA0vBfNubHGddafrP/j6FSQg0MX5qiNmo=; 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=RWxZZMN7tWg0hZhsLa4qpC4uwAi/XeaNBd1ZJqhAI7J6QT+HF9sc2lvPDIZSoS0eq LIdNbfLQ9vti5l8Mi0wJYviqH6NXkGBPgZh7CRI0ymcynsyyCAmO9+NIwfBQ4XgHt2 IlJQ8cqLLUCRwOzCnu3eoCNLzeafLN5Ro28e2LAA= Received: from send127.i.mail.ru (send127.i.mail.ru [89.221.237.222]) (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 7393964BB41 for ; Tue, 10 Mar 2026 10:29:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7393964BB41 Received: by exim-smtp-695fc89d9f-jwl6r with esmtpa (envelope-from ) id 1vzrWd-000000004TL-0xGb; Tue, 10 Mar 2026 10:29:07 +0300 Content-Type: multipart/alternative; boundary="------------rtkUrmg0SzxzYDbJrpXSTGDt" Message-ID: <208fb058-9dbb-469c-b5e1-6ff3a532e971@tarantool.org> Date: Tue, 10 Mar 2026 10:29:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD91ABAE9865AC7DC882EF358000D3DA878D748AF93732B0C94182A05F538085040F3D482037B32824F3DE06ABAFEAF67057FBCC362518B0E41D27684EDF7D06DE1B7464F346B62472A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70D278D70F8433719EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB553375665A08EF23E7B416AB63719429869BB616536A7A2A62BBF829130545213688B905389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0A3E989B1926288338941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6E5E764EB5D94DBD4CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249783E2B6F79C23BED3AA81AA40904B5D9CF19DD082D7633A0C84D3B47A649675F3AA81AA40904B5D98AA50765F7900637F24693029971C26FEC76A7562686271ED91E3A1F190DE8FD2E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C36174550A02D153F535872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: 6FEFE4C63DFE2D8532C3C7A134B807951D49B9A4D3932D29834459D11680B505E4E280AB0F2B909CD132CE41481BE051 X-C1DE0DAB: 0D63561A33F958A58620CAE37D8144AF5002B1117B3ED696C5E014FC6DA1E9D8361FAC1196A180DE823CB91A9FED034534781492E4B8EEAD47A3109F1ACFD409BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F962AFAD3E4DDF5968D25B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D65978D2FE959320E818C3AE6F9AD8791B66648CE8F55A98ADFB8636EC28A7C22F17D43B0A971420A7EDB8341EE9D5BE9A0A882D5AFBD28420B7418D24ECCC7F62E537193ECE35171E0B8CD93680B12512CF4C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdbVVJCphTR/1uEvKhkoF8Q= X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F258845853DD2F392162A1EACE7DA15FCD53A221FE565BC339FD0FE35102A076D2E864F4645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/2] Fix edge cases when generating IR for string.byte/sub/find. 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. --------------rtkUrmg0SzxzYDbJrpXSTGDt Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey, thanks for the patch! LGTM with a minor comment below. Sergey On 3/6/26 16:42, Sergey Kaplun wrote: > From: Mike Pall > > Contributed by XmiliaH. > > (cherry picked from commit af9763a50da87ff8ba16e828cbd5664135e05a88) > > The generated ADD/SUB IRs for the calculation of indexes in the string > for the aforementioned build-ins don't check the overflow. This may lead s/build-ins/built-ins/ > to the incorrect results, incorrect trace semantics, or invalid memory > access. Also, the negative values may pass the UGT guard check emitted > for the positive `end` position and lead to the incorrect results on the > trace. > > This patch fixes this by using guarded ADDOV/SUBOV instead. The UGT IR > is replaced with GT. > > Sergey Kaplun: > * added the description and the test for the problem > > Part of tarantool/tarantool#12134 > --- --------------rtkUrmg0SzxzYDbJrpXSTGDt Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey,

thanks for the patch! LGTM with a minor comment below.

Sergey

On 3/6/26 16:42, Sergey Kaplun wrote:
From: Mike Pall <mike>

Contributed by XmiliaH.

(cherry picked from commit af9763a50da87ff8ba16e828cbd5664135e05a88)

The generated ADD/SUB IRs for the calculation of indexes in the string
for the aforementioned build-ins don't check the overflow. This may lead
s/build-ins/built-ins/
to the incorrect results, incorrect trace semantics, or invalid memory
access. Also, the negative values may pass the UGT guard check emitted
for the positive `end` position and lead to the incorrect results on the
trace.

This patch fixes this by using guarded ADDOV/SUBOV instead. The UGT IR
is replaced with GT.

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

Part of tarantool/tarantool#12134
---

<snipped>

--------------rtkUrmg0SzxzYDbJrpXSTGDt--