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 359A96E454; Fri, 11 Feb 2022 22:13:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 359A96E454 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1644606785; bh=XdyvU/SWbF/YlzHOpNf10uxX7ofS1idTzQcz86mUJjM=; 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=brgShnCfE3bmBdll0KnGWGYs421GkDU+lAdKYukh/i3yJtPI93DeDXZpCa4/0Aof/ p0gHyW+tUzZb7/7zXohRx9n62WTy6wJ8R9AwMyyMEpM8C7/wx65D+t+zitirXujTma dgOHlBYrJh4odgVi3f8MzsoYXE2BRIH/X6C7z218= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (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 B41466E454 for ; Fri, 11 Feb 2022 22:12:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B41466E454 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1nIbLV-0003dv-RH; Fri, 11 Feb 2022 22:12:42 +0300 Date: Fri, 11 Feb 2022 22:09:26 +0300 To: Sergey Kaplun Message-ID: References: <20210820154846.5515-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210820154846.5515-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD94A599DE53EADEE57E4EFE5B10645A8D6D923582AFEE8CC85182A05F538085040C21C423B2D3856BDEE4B8C9859F7CC11F7A4285B0F1F960910CB5FCBC67A3F8F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE76D34FAA3D8B31588C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE71BB7708D34E2BFDAEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BEBC5CAB6D411FFA634E594A6C75AE801C7594249C4C08AD2CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BB9CEE4F2B4A90F8475ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 0D63561A33F958A57D635EAF8F06DB550067E9D3EFF5F4D57E6598A832A72386D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7506FE1F977233B9BB410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AF12ADB97C97CD890FC55D365E6B5598021869B7053B032847D9C63FC27FEFEDABC7FA2D3085C71C1D7E09C32AA3244C409E6FFA1F09E4643EE6CF97E5EEFB4E3A92A9747B6CC886927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj0jP+VWF3k0cXyPcs+5z1JA== X-Mailru-Sender: 689FA8AB762F739339CABD9B3CA9A7D65D7747B69D702C80EE9FE7A04B010173A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix string.char() recording with no arguments. 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 patch into all long-term branches in tarantool/luajit and bumped a new version in 1.10, 2.8 and master. On 20.08.21, Sergey Kaplun wrote: > From: Mike Pall > > (cherry picked from commit dfa692b746c9de067857d5fc992a41730be3d99a) > > `string.char()` call without arguments yields an empty string. When JIT > machinery records the aforementioned call it doesn't handle this case. > Each recording fast function expects 1 result by default. Hence, when > return from this call is recorded the framelink slot is used as a > result. It is loaded into the corresponding slot as an IR with `IRT_NUM` > type. It leads to assertion failure in `rec_check_slots()`, when a next > bytecode is recorded, because type of TValue on the stack (`LJ_STR`) > isn't the same as IR (and TRef) type. > > This patch handles the case without arguments by the loading of IR with > empty string reference into the corresponding slot. > > Sergey Kaplun: > * added the description and the test for the problem > > Resolves tarantool/tarantool#6371 > --- > > Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-6371-string-char-no-arg > Issue: https://github.com/tarantool/tarantool/issues/6371 > Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-6371-string-char-no-arg > Side note: CI is totally red, but AFAICS it's unrelated with my patch. > Side note: See also Changelog at the Tarantool branch. > > src/lj_ffrecord.c | 2 ++ > .../gh-6371-string-char-no-arg.test.lua | 28 +++++++++++++++++++ > 2 files changed, 30 insertions(+) > create mode 100644 test/tarantool-tests/gh-6371-string-char-no-arg.test.lua > > -- > 2.31.0 > -- Best regards, IM