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 4BA0C74150; Tue, 5 Oct 2021 20:38:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4BA0C74150 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1633455518; bh=LAxgiVaueqNTP9LcosQqp6PI94bdu/LKdz62iaPeM7I=; 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=Toz8YGzSZtbKcPa/Q7qDCP+vhKq3JjhuvIB1L+HW9mWGXIjdjHxNk2d0Co52Amrt4 6LFlk8/rwg8cdeeSxsD3ZkQMkPZcHB/shpiillk8AccyDdFMkNORmbXFVZyt6VaN4s UozWBsELJDcGEtmAUzhhphvtnOK6PKwkYzRisvxI= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id EC5C97414F for ; Tue, 5 Oct 2021 20:38:36 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EC5C97414F Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mXoOi-0002i5-0g; Tue, 05 Oct 2021 20:38:36 +0300 Date: Tue, 5 Oct 2021 20:37:06 +0300 To: Maxim Kokryashkin Message-ID: References: <20210924182046.134195-1-m.kokryashkin@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210924182046.134195-1-m.kokryashkin@tarantool.org> X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD95441136EB4F024914A26815231D58CF110DE257AEEEF73C9182A05F538085040BBB35189465222330094A48BB0EB83E1D7FC1750FC30A45B68C62D2A5AF1B4ED X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C8140302C704C25FEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F97367C191A19EB28638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D849602B32A30F1AFB588C4A2CF86875FB117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAE9A1BBD95851C5BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18BDFBBEFFF4125B51D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B60A62CEF541B197C8089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5F9671A612146A3BA155C229C734C4BDDF01D0187E793EF0CD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75C4D20244F7083972410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344E332383F80D58BB15639F869F9C50D8D1723ADBD7A3233292EDDEE70B917B5486B5D090ECAEE3491D7E09C32AA3244C6E242D617AE055B4534F276CF46965A77C0C08F7987826B9927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojhAh8SZXECpDM7XKoK//fNw== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DADFFB889EA668713088BFFA89F367A130FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED567EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] test: adapt test checking global environment 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, Maxim! Thanks for the patch! LGTM, with a few nitpicks below. On 24.09.21, Maxim Kokryashkin wrote: > LuaJIT doesn't take into account tail calls for > call-level counting, so `getfenv()` behaviour is different > in tail calls. getfenv()` default level is 1 which is invalid for > the test case when is called from tail call (`lj_debug_frame()` > returns NULL). > > This commits adds local varible, so there is no tail call any more. Typo: s/varible/variable/ > > Closes tarantool/tarantool#5713 > Part of tarantool/tarantool#5845 This issue is already closed via disabling the aforementioned test. Just refer 5870 ticket instead. > Part of tarantool/tarantool#4473 It is better to mention 5870 only. We want epics to stay clear, IINM. > --- > Issue: https://github.com/tarantool/tarantool/issues/5713 > GitHub branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5713-adapt-test-global-environment-PUC-Rio Please, share the Tarantool branch with the patch to check that CI still works :). > > test/PUC-Rio-Lua-5.1-tests/closure.lua | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/test/PUC-Rio-Lua-5.1-tests/closure.lua b/test/PUC-Rio-Lua-5.1-tests/closure.lua > index 551fe70d..c0377179 100644 > --- a/test/PUC-Rio-Lua-5.1-tests/closure.lua > +++ b/test/PUC-Rio-Lua-5.1-tests/closure.lua > @@ -167,22 +167,24 @@ local function foo (a) > assert(getfenv(0) == a) > assert(getfenv(1) == _G) > assert(getfenv(loadstring"") == a) > - return getfenv() I suppose that we can move the comment here to explain the change. > + local env = getfenv() > + return env > end > > f = coroutine.wrap(foo) > local a = {} > assert(f(a) == _G) > local a,b = pcall(f) > --- FIXME: LuaJIT doesn't take into account tail calls for > +-- LuaJIT doesn't take into account tail calls for > -- call-level counting, so `getfenv()` behaviour is different > -- in tail calls. For example, this `pcall()` returns false, Minor: returns false in case of tailcall, strictly saying, as far as you change the function behaviour. > -- because `getfenv()` default level is 1 which is invalid for > -- this case when is called from tail call (`lj_debug_frame()` > -- returns NULL). > -- See also https://github.com/tarantool/tarantool/issues/5713. > --- Test is disabled for LuaJIT for now. > --- assert(a and b == _G) > + > +-- Test is adapted to the behavior LuaJIT. > +assert(a and b == _G) > > > -- tests for multiple yield/resume arguments > -- > 2.33.0 > [1]: https://github.com/tarantool/tarantool/issues/5870 -- Best regards, Sergey Kaplun