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 6CF4F608E92; Thu, 31 Aug 2023 18:36:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6CF4F608E92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1693496213; bh=N992jLUTkOKFj50Yf2b36jq8auk7RdmVWDr7pF04+lk=; 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=GRPZNjOMtujzWY+EaUJEy4DpZBHvkod642v5XeeQ2Howpk7qRg6xCB36qQJ4XGofF xaN1SsJbgibqy9cUD0ahB8IUFNIV5CXG/VYwyyJgHiCQrIZytBkx9AvjIT3eyYULmj dSRTzJO6QkQu3JjumU8IK+XswyzPsgt81pRY6Kyw= Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [95.163.41.96]) (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 6A3AB608E87 for ; Thu, 31 Aug 2023 18:36:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6A3AB608E87 Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1qbjig-000X6C-1G; Thu, 31 Aug 2023 18:36:31 +0300 Date: Thu, 31 Aug 2023 15:19:06 +0000 To: Sergey Kaplun Message-ID: References: <20230815142541.29855-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230815142541.29855-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD96E142CFC92DB15CD9A7859371734312374D1E4EA2190E575182A05F538085040EBFCD0880F30532BC1C09643729C7B495DE17667C84E0D55F3275F16CB64D767 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75210414551E8CD62EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063767500BC4578134A08638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D88A1560C7B1A92BB561A37B10990F8385117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC07CB022245CAE856389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8062BEEFFB5F8EA3EF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CF8BD4E506CFA3D8803F1AB874ED890284AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C325C33BDE98D8A053BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE76D0F27F7E6A6C418731C566533BA786AA5CC5B56E945C8DA X-B7AD71C0: 6FEFE4C63DFE2D85718F43753FD9AD21390936EE2A242988633761F9DFDC81E914C49B4F7E0FB685753E40F60159063B X-C1DE0DAB: 0D63561A33F958A5B3CE98CC102A962F869F4693AE2A82DF0C883B46308A393FF87CCE6106E1FC07E67D4AC08A07B9B01DAA61796BF5227BCB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC71106E36FF2641B7B8424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D3447DF5779098ECEE92B378779C40754FF9A4F25E1CF8C23F2BD8FF485AAD6080743CDCF0278E13C321D7E09C32AA3244C4C9410B91900E3B2D95B5F09FF6F575830363D8B7DA7DD44BAD658CF5C8AB4025DA084F8E80FEBD376A4ED3E9341DC2FCD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj6jqRMsEo8wdPY+Sz1OUGDA== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D5318D99D21FB4EC4898B00DC10A0BC6715D68F418C96F7F1BFE2326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, I've checked the patchset into all long-term branches in tarantool/luajit and bumped a new version in master, release/2.11 and release/2.10. On 15.08.23, Sergey Kaplun via Tarantool-patches wrote: > From: Mike Pall > > Reported by Sergey Kaplun. > > (cherry-picked from commit caf7cbc57c945f7b68871ad72abafb2b6e6fb7f5) > > Assume, we have the following Lua code: > | local _ > | for _ in (nil):foo() do end > > The first part of the bytecode emitted for it is the following: > | 0001 KNIL 0 1 > | 0002 MOV 2 1 > | 0003 TGETS 1 1 0 ; "foo" > | 0004 CALL 1 4 2 > > The `0001 KNIL` is a result of merging two `KPRI` instructions: one for > the local variable, one for the slot with `nil` object. During parsing in > `predict_next()` the second `MOV` bytecode is examined to set `pairs` or > `next` local variable. But, as far as it moves `nil` value, that isn't > an actual variable, so it has no the name this leads to the crash. > > This patch adds the check to be sure that `RD` in the `MOV` bytecode is > an actual variable. > > Sergey Kaplun: > * added the description and the test for the problem > > Part of tarantool/tarantool#8825 > --- > > Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-1033-fix-parsing-predict-next > PR: https://github.com/tarantool/tarantool/pull/8987 > Related issues: > * https://github.com/LuaJIT/LuaJIT/issues/1033 > * https://github.com/tarantool/tarantool/issues/8825 > > src/lj_parse.c | 1 + > .../lj-1033-fix-parsing-predict-next.test.lua | 30 +++++++++++++++++++ > 2 files changed, 31 insertions(+) > create mode 100644 test/tarantool-tests/lj-1033-fix-parsing-predict-next.test.lua > > -- > 2.41.0 > -- Best regards, IM