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 D6DD9CCE25C; Fri, 13 Sep 2024 18:49:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D6DD9CCE25C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1726242548; bh=SF7nOwseryMoZZKE7FNUakW7zJA87VFMJuA6KUhFX1M=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=mg+EIrp6JpV+4CKWPq24D1l03c4lQ6t78tXbGSLfGCwuydyGTJiK4j3LMpne9QyhV BKKs9GOdU1Y2jstGcdV1pAOEyPDqQQh5LadirdQD14+T+EFxRVI/Djh9DS6ZbHTEJm 2pTOa/WoVuEU0STGFuarRUpB5lgvIin7CiRUubwA= Received: from smtp49.i.mail.ru (smtp49.i.mail.ru [95.163.41.91]) (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 BC229CCE25D for ; Fri, 13 Sep 2024 18:49:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BC229CCE25D Received: by smtp49.i.mail.ru with esmtpa (envelope-from ) id 1sp8Xh-00000004QU4-3BG5; Fri, 13 Sep 2024 18:49:06 +0300 Date: Fri, 13 Sep 2024 18:48:55 +0300 To: Sergey Bronnikov , tarantool-patches@dev.tarantool.org Message-ID: References: <20240821082316.4880-1-skaplun@tarantool.org> <695c49d0-f2f0-4cfb-b5d3-e4ac52d1f455@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9149934E261B3C8509CD54408423D8E9D8DF6D6EA7DAA4C99182A05F538085040E218AA8FD26BB43FD4FF92D56319F19756ACA06DB5EC28E40C38E0F431A2F780DC3326C543D49E8D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7E30E47A50CB819D6C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE77FAFB841CE9024F9EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B043BF0FB74779F3606E1ED4EC5EA0B835E15682F00EA71BD04ECC6ADE02BC395A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7328B01A8D746D8839FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C390D92131081DE748117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947C2FFDA4F57982C5F42E808ACE2090B5E1725E5C173C3A84C317B107DEF921CE79089D37D7C0E48F6C8AA50765F79006372A310894EFA5E9A9EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5652A01C5DF2566B85002B1117B3ED6966FB6884074B17BEFFB820E9FE7BD014C823CB91A9FED034534781492E4B8EEAD9CFA8CFAC159CE19BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF747FB2984EE5845E95A3844C5AA19B49E9267DFD441DF03E291CC2042D3F6809A96D85E4AF70DF37BEF149BEF2827C68168B6640545A68A3BF89FA8BD82F37D5C1DF2FB497A57CEE111DC66A97D0BFE2913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmn7hiCWKTuj2lOvFx7ZzWA== X-DA7885C5: 12369F309B2576ACF255D290C0D534F920206EA1D6201B02B3AF6B713D8EB66CD0F02FB25C8857C75B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393C6D0B12EA33CAA9BF0D088601B7E34C41617E3E8A4DD1C3C492098B927071A39E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Restore state when recording __concat metamethod throws an error. 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" One more minor update below. On 13.09.24, Sergey Kaplun via Tarantool-patches wrote: > Hi, Sergey! > Thanks for the review! > > On 13.09.24, Sergey Bronnikov wrote: > > Hi, Sergey, > > > > thanks for the patch! LGTM with a minor comment. See below. > > > > On 21.08.2024 11:23, Sergey Kaplun wrote: > > > > > > > > > > > +-- Need to use metamethod call in the concat recording. > > > +debug.setmetatable(nil, { > > I propose to add a comment that explain why `nil` is used here. > > I've removed the nil usage to avoid confusion. > Branch is rebased on the current master and force-pushed. > =================================================================== > diff --git a/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua b/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua > index 9abaeba5..4fe02708 100644 > --- a/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua > +++ b/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua > @@ -12,12 +12,13 @@ test:plan(2) > > jit.opt.start('hotloop=1') > > -local __concat = function(v1, v2) > - return tostring(v1) .. tostring(v2) > +local __concat = function() > + return '' > end > > -- Need to use metamethod call in the concat recording. > -debug.setmetatable(nil, { > +-- Let's use a table with the metamethod. > +local concatable_t = setmetatable({}, { > __concat = __concat, > }) > > @@ -31,7 +32,7 @@ local function test_concat_p() > -- `lj_record_ret()` restore the Lua stack (before the patch), > -- it becomes unbalanced after the instruction recording > -- attempt. > - local _ = {} .. (nil .. nil) > + local _ = {} .. (concatable_t .. concatable_t) > end > end > > =================================================================== Added more verbose description: =================================================================== diff --git a/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua b/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua index 4fe02708..75736e74 100644 --- a/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua +++ b/test/tarantool-tests/lj-1234-err-in-record-concat.test.lua @@ -17,7 +17,8 @@ local __concat = function() end -- Need to use metamethod call in the concat recording. --- Let's use a table with the metamethod. +-- We may use any object with a metamethod, but let's use a table +-- as the most common one. local concatable_t = setmetatable({}, { __concat = __concat, }) =================================================================== > > > > + __concat = __concat, > > > +}) > > > + > > > > -- > Best regards, > Sergey Kaplun -- Best regards, Sergey Kaplun