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 727B2D6547A; Fri, 13 Sep 2024 18:27:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 727B2D6547A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1726241232; bh=mj33CBrM07jOGlb3uqK5ayq6oU6CPRcnEe9iYYSOyWQ=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=KZGvALpuljM0tUbY7bM0F2P8PhpjC8IIAMEYyjx19UMxpBLb8GLR37Fhb9YtOwoEj Djde2PA9XzjtGa2baqFAWYEVOtK3jSYDM/On12XZDhWpsRohfIvs/6fMqgh2EQ7oem 5O6RAxgqsfhaww85ZJG/9Dg31V8BBBaWovL/6CvE= Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [95.163.41.64]) (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 2F4CBD65460 for ; Fri, 13 Sep 2024 18:27:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2F4CBD65460 Received: by smtp41.i.mail.ru with esmtpa (envelope-from ) id 1sp8CU-000000027sO-1rZ0; Fri, 13 Sep 2024 18:27:10 +0300 Date: Fri, 13 Sep 2024 18:27:00 +0300 To: Sergey Bronnikov 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: <695c49d0-f2f0-4cfb-b5d3-e4ac52d1f455@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9149934E261B3C850554FEC5FAF983AD8F105DA10ED692247182A05F5380850405D65EC7BB7B0F960F378A8CA21F699D65686D93C16A2B597E2A0F106E43FE0156DAB6CAFCF3FA656 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE788EDE44B2AC36D7BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637329F9579A0E72DCC8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84159CFB41A5174E2FE9318975A2ED169DBE03786CE182B15CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F790063793270F7220657A0A389733CBF5DBD5E9B5C8C57E37DE458B9E9CE733340B9D5F3BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7350555CCFDA08FA3FAC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5C04843FBA57E33895002B1117B3ED696973824141ACFC2214869453249F34FA4823CB91A9FED034534781492E4B8EEADA3A806F356AF31D6 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF9C6B4B5225D9BE596E985EEFA763539EF1F767FA7A82DE5F58E59FD09AFFE63A35D9E4C97941E9B1BEF149BEF2827C685D76129F139CCCFB12550EF89DA26BF8D7EFB699B960E6EB5F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmn7hiCWKTugawXofpJIWDQ== X-DA7885C5: BE3AFE00B0A25606F255D290C0D534F9091EB1176291928A1FC6D8EF61CC7AA9D473E76102B498B45B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393C6D0B12EA33CAA9B5946B511A63406C33F111E9A513F9B44B3A5FFEEBAE7C028E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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 =================================================================== > > + __concat = __concat, > > +}) > > + -- Best regards, Sergey Kaplun