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 AE082576498; Wed, 9 Aug 2023 18:48:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AE082576498 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1691596109; bh=QEia6H5/Xi3SI4a+o7/k3n4Lgdyt80+CWSQc3PK9Pm8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=JewbrGBC5shiyU0cSUPh9WOeXVOxpStMbpCiIg6eaUXu5BGUqhF8SGlaAUqypZgSU 7HRnYAtR8AtPia/bO7yWyXEAR/omde7FC2qJdns1oJ0yHxn73WbSIgMl6rkWAjWaWd eG2fAG0HE8j967m4NnSgBFfgv0jTxo3QxrWlKj5o= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [95.163.41.73]) (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 EE34657649B for ; Wed, 9 Aug 2023 18:41:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EE34657649B Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1qTlJF-003Nbf-1J; Wed, 09 Aug 2023 18:41:17 +0300 To: Igor Munkin , Sergey Bronnikov Date: Wed, 9 Aug 2023 18:36:04 +0300 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD94DC436DAD9FF86068A8B70255D5151F61D5B4853E07EEE2F182A05F5380850404C228DA9ACA6FE2723D64174D24D2E1E39BC923D1AD8FECEC8D366FBF86FDEBD34D7E1837F90B853 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7D77100FFB2844417EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637DD92412F72BDCE938638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D845E6D76F49169F705FD9E208F78998B2117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC911D863C7A028B9E389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8989FD0BDF65E50FBF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C1E1736EDDE8D4790BA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B646906D4753B15FC03AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735D05AD665AB97B35DC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5DFE9E7B194B7C6F22F6BEBBAB7CE8134DE0984AC4959E9A9F87CCE6106E1FC07E67D4AC08A07B9B04E7D9683544204AF9C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A092FFDA4F57982C5F4CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF53C8039D4964F095D850F77161E90E0E289A04EFC9D38F2CD7E1E9CAA52B990780D6A24BA0071DC01529AA6C8ABD04CA31314E418832DCE1D4F3356A816EFD8BA74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojUzxoxvtYX2pzkQtW1/qmkA== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769BB870DA8E5B2A44339BC923D1AD8FECEE8285F0AB37D98A7DEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: [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: 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" From: Mike Pall Thanks to Yichun Zhang. (cherry-picked from commit 1c89933f129dde76944336c6bfd05297b8d67730) This patch is predecessor for the commit 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, 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 for details), we can't obtain this assertion failure. This patch is added for the consistency with the upstream. 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