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 5C80E5764A9; Wed, 9 Aug 2023 18:47:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5C80E5764A9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1691596079; bh=TO7NcVbKMJbwCmFPjSndDgNqLNTwuVXnx73WnxSadl8=; 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=dfaqykhoJM3za7h+8MwGIlQqwukdBrUgL/ZWmPG+/KcLlkyVcFw/s9ZSra3uToQgp ScT5bI3RfVdnm9tCA8hU2APRI6wTEIr9ITiW3GQFmE+XNC3Dy2rUo1LNLjOsUyJXa4 RRE5w6kKioT/ctAeszUCZZ7oOTwmms3d3AezvnQA= 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 D2F1257649A for ; Wed, 9 Aug 2023 18:41:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D2F1257649A Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1qTlJD-003Nbf-0o; Wed, 09 Aug 2023 18:41:15 +0300 To: Igor Munkin , Sergey Bronnikov Date: Wed, 9 Aug 2023 18:36:03 +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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD969E04B5EED670DC864E28ABE09E133B4A5846C191BD37C58182A05F538085040A2F869451D7F5F75E8F4881418B56D3E8E9BB8E5D7E6ACB77EE11BBA37135FFE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73B44982FA5E78411EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006370F98874192B1BA168638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8E706E2DF1E94D9409197E8382C079DE0117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3EA24FE487C076E5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FCB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE4B6963042765DA4BBA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B69F5E362153655AB1D81D268191BDAD3D3666184CF4C3C14F3FC91FA280E0CE3D1A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F83C798A30B85E16B5E1C53F199C2BB95B5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A54CCA3098D1B2B5322F6BEBBAB7CE8134CAE5EE17E875C088F87CCE6106E1FC07E67D4AC08A07B9B0DB8A315C1FF4794DC79554A2A72441328621D336A7BC284946AD531847A6065A17B107DEF921CE79BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFBFBED981198048E75004BD18B59CFACC2B6A7B3EC2B9DAF9E8564AD7E2A0481A49C71475D3C809311529AA6C8ABD04CABFDBED5E2006ACB49568C74E34581AEEA74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojUzxoxvtYX2pzkQtU1/qmkA== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A76907C535F6DB098694E8F4881418B56D3E38066306E4938E9FDEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 14/19] Fix debug.getinfo() argument check. 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 Sergey Ostanevich. (cherry-picked from commit 0cd643d7cfc21bc8b6153d42b86a71d557270988) This patch just reverts the commit 48f463e613db6264bfa9acb581fe1ca702ea38eb ("luajit: fox for debug.getinfo(1,'>S')") and applies the one from the main repo for the consistency with the upstream. --- src/lj_debug.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/lj_debug.c b/src/lj_debug.c index 654dc913..c4edcabb 100644 --- a/src/lj_debug.c +++ b/src/lj_debug.c @@ -431,16 +431,12 @@ int lj_debug_getinfo(lua_State *L, const char *what, lj_Debug *ar, int ext) TValue *frame = NULL; TValue *nextframe = NULL; GCfunc *fn; - if (*what == '>') { /* we have to have an extra arg on stack */ - if (lua_gettop(L) > 2) { - TValue *func = L->top - 1; - api_check(L, tvisfunc(func)); - fn = funcV(func); - L->top--; - what++; - } else { /* need better error to display? */ - return 0; - } + if (*what == '>') { + TValue *func = L->top - 1; + if (!tvisfunc(func)) return 0; + fn = funcV(func); + L->top--; + what++; } else { uint32_t offset = (uint32_t)ar->i_ci & 0xffff; uint32_t size = (uint32_t)ar->i_ci >> 16; -- 2.41.0