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 7046A589F42; Tue, 15 Aug 2023 17:07:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7046A589F42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1692108433; bh=Q+SlJo/6tLW5g+JXX+1Nxoj09l+apdDSJp9Co/UJgiU=; 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=r8D844DdSyuefiEhD1oz30B87pJOLHQ1Kjp6tCqygbychtnsYNX5fICK+BRDMoue7 69/tGGtAJZoqgKFeIpdbPxfWtlG7FUkQ1+uVHtAaxxuXH9lJL95gg4/+ykgHqzGMAo JTjdb/7FqQEyfQKPZKVE9jaXCcQNIHf03XVFtQt4= Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [95.163.41.97]) (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 ACF64589F42 for ; Tue, 15 Aug 2023 17:07:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org ACF64589F42 Received: by smtp59.i.mail.ru with esmtpa (envelope-from ) id 1qVuhS-00CyBH-09; Tue, 15 Aug 2023 17:07:10 +0300 Date: Tue, 15 Aug 2023 17:07:09 +0300 To: Sergey Kaplun Message-ID: <6n7ziyckasjdkbhbvba3v7gpzchvbfi2fl5dn5jsoa3vtwltet@atywztqnppsv> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD969E04B5EED670DC8BEB87106826C4595A10F7F5F18564AA6182A05F5380850406B181EA04D301709A533D707A8C04C589EA3F380DF6D422C3A239246557F0464 X-C1DE0DAB: 0D63561A33F958A5A2A13C426E3D2866F3EDA4939745421C4FBEB7549D0728E0F87CCE6106E1FC07E67D4AC08A07B9B04AB4081B6A6C2E07CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0AD5177F0B940C8B66ECE892A7B2722663E91682638B966EB3F662256BEEFA9527FDAE3C7F83BDFE6B3C1AE29571204C0B8D2F3CF20438D457B4C1A0284BF91A71668AD0CD083CBD56437FD76D11AF80A0D564F6B6C3A99E962431CBDADB2C06B67EA455F16B58544A21C197AAF4D2E4732965026E5D17F6739C77C69D99B9914278E50E1F0597A6FD5CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojHVl7ekwB6hgkSrvMkdqZxg== X-Mailru-Sender: 11C2EC085EDE56FA38FD4C59F7EFE4078AFF318DAFFA6543AAC7C3CC687E6BF694E9A093BA7D1E92D51284F0FE6F529ABC7555A253F5B200DF104D74F62EE79D27EC13EC74F6107F4198E0F3ECE9B5443453F38A29522196 X-Mras: OK Subject: Re: [Tarantool-patches] [PATCH luajit 15/19] Fix LJ_MAX_JSLOTS assertion in rec_check_slots(). 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: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the patch! LGTM, except for a few comments below. On Wed, Aug 09, 2023 at 06:36:04PM +0300, Sergey Kaplun via Tarantool-patches wrote: > From: Mike Pall > > Thanks to Yichun Zhang. > > (cherry-picked from commit 1c89933f129dde76944336c6bfd05297b8d67730) > > This patch is predecessor for the commit Typo: s/is predecessor for the/is the predecessor to/ > 944d32afd6ddd9dbac1cddf64bf81333efeb9e30 ("Add missing LJ_MAX_JSLOTS > check.") It tries to fix the issue, when `J->baseslot == LJ_MAX_JSLOTS`, > that leading to the assertion failure. Since the predecessor patch, Typo: s/leading/leads/ > there are no places, that can lead to the condition failure, since we > always check that new baseslot + framesize (+ vargframe) >= > `LJ_MAX_JSLOTS`. As far as minimum framesize is 1 (see Typo: s/as minimum/as the minimum/ > for details), we can't obtain this assertion failure. This patch is > added for the consistency with the upstream. Typo: s/the consistency/consistency/ > > Since the predecessor patch fixes the issue, there is no new test case > to add. > > Sergey Kaplun: > * added the description for the problem > > Part of tarantool/tarantool#8825 > --- > src/lj_record.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/lj_record.c b/src/lj_record.c > index 02d9db9e..6030f77c 100644 > --- a/src/lj_record.c > +++ b/src/lj_record.c > @@ -87,9 +87,9 @@ static void rec_check_slots(jit_State *J) > BCReg s, nslots = J->baseslot + J->maxslot; > int32_t depth = 0; > cTValue *base = J->L->base - J->baseslot; > - lua_assert(J->baseslot >= 1+LJ_FR2 && J->baseslot < LJ_MAX_JSLOTS); > + lua_assert(J->baseslot >= 1+LJ_FR2); > lua_assert(J->baseslot == 1+LJ_FR2 || (J->slot[J->baseslot-1] & TREF_FRAME)); > - lua_assert(nslots < LJ_MAX_JSLOTS); > + lua_assert(nslots <= LJ_MAX_JSLOTS); > for (s = 0; s < nslots; s++) { > TRef tr = J->slot[s]; > if (tr) { > -- > 2.41.0 >