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 A1CEB5B35C6; Thu, 24 Aug 2023 10:50:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A1CEB5B35C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1692863402; bh=8jmO42ON+EykQjH41adwK6eyr4sTbiI9JS5UVyfpj7k=; 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=xQxetB5+L32zfUzjcbAeaTb0MHClv5zlZQI0dtRWt1PfzDAT41wEMVmeyijKlkoSk n+U0DVTeg3uI7OB+OvwfYhXAZDSPWFWS933oHXufObPUwpVJu4zSNrW8y1cMheRltO 7re4ehPWlTqcX/j6fcnI6q8u6CJDzGpEWnkWTszQ= Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [95.163.41.84]) (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 606335B35C6 for ; Thu, 24 Aug 2023 10:50:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 606335B35C6 Received: by smtp46.i.mail.ru with esmtpa (envelope-from ) id 1qZ56O-00E8NP-2J; Thu, 24 Aug 2023 10:50:01 +0300 Message-ID: <25ed554e-e6f7-bc47-654c-1810dc64cbee@tarantool.org> Date: Thu, 24 Aug 2023 10:50:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Sergey Kaplun References: <20230815142541.29855-1-skaplun@tarantool.org> <35c90999-f893-ed59-034d-4986e7b44b72@tarantool.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD93C8852532D76B9E3B62DC7F09619FD73B4ABEF74D25B7E0A182A05F538085040D8F4E988DFD9C042915379EF61F6385BE8B339301437C83C3F5C88497F394E57 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DB45732B85BEE83BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CDA089757FB31C668638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D823FADBD57535031A6CD3DCE79D4C9E0A117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC4AFB60FD1831C04CA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18BDFBBEFFF4125B51D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE9647ADFADE5905B19100238FE36DC7A2D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE34E7D9683544204AF03F1AB874ED89028C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947C2FFDA4F57982C5F42E808ACE2090B5E1725E5C173C3A84C317B107DEF921CE79089D37D7C0E48F6C8AA50765F7900637A63D8D502DFAF8B5731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A57CDB8FB556A510C8B979F9CC56F235D47F778DF1D6828D26F87CCE6106E1FC07E67D4AC08A07B9B0735DFC8FA7AC1207CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFAC4DA57F11552CFD598234310700A45AFA95CBA0D0DA05960B614E59B5CDC060ABDA6BB679979B9565277D9847CC050AF2D4921B0AD696707557F70C36C06392E48CAC7CA610320002C26D483E81D6BE0DBAE6F56676BC7117BB6831D7356A2DEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbN4zljfpmjG4JCM2RPxrbw== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769BC3512946AAF5DD4915379EF61F6385BE8285F0AB37D98A7EBA65886582A37BD66FEC6BF5C9C28D98A98C1125256619760D574B6FC815AB872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix predict_next() in parser. 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, On 8/22/23 18:17, Sergey Kaplun wrote: >>> + >>> +local res, err = pcall(res_f) >>> + >>> +test:ok(not res, 'loaded function not executed') >> it is not clear for me what for do you need checking result code. I >> would omit it. >> >> Feel free to ignore. > Added the following comment to avoid confusing (see the whole iterative > patch below): > > =================================================================== > diff --git a/test/tarantool-tests/lj-1033-fix-parsing-predict-next.test.lua b/test/tarantool-tests/lj-1033-fix-parsing-predict-next.test.lua > index 63998d8c..fed3ff6c 100644 > --- a/test/tarantool-tests/lj-1033-fix-parsing-predict-next.test.lua > +++ b/test/tarantool-tests/lj-1033-fix-parsing-predict-next.test.lua > @@ -3,10 +3,6 @@ local test = tap.test('lj-1033-fix-parsing-predict-next') > > test:plan(3) > > -local res_f = loadstring([[ > --- This local variable is necessary, because it emits `KPRI` > --- bytecode, with which the next `KPRI` bytecode will be merged. > --- > -- The resulting bytecode is the following: > -- > -- 0001 KNIL 0 1 > @@ -16,14 +12,18 @@ local res_f = loadstring([[ > -- > -- This MOV doesn't use any variable value from the stack, so the > -- attempt to get the name in `predict_next() leads to the crash. > +local res_f = loadstring([[ > +-- This local variable is necessary, because it emits `KPRI` > +-- bytecode, with which the next `KPRI` bytecode will be merged. > local _ > for _ in (nil):foo() do end > ]]) > > -test:ok(res_f, 'chunk loaded sucsessfully') > +test:ok(res_f, 'chunk loaded successfully') > > local res, err = pcall(res_f) > > +-- Check consistency with PUC Rio Lua 5.1 behaviour. > test:ok(not res, 'loaded function not executed') > test:like(err, 'attempt to index a nil value', 'correct error message') > > =================================================================== > > Branch is force-pushed. > Thanks! LGTM now. >> >>> +test:like(err, 'attempt to index a nil value', 'correct error message') >>> + >>> +test:done(true)