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 49FEC6ECE3; Thu, 30 Jun 2022 15:16:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 49FEC6ECE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1656591411; bh=hwOy2wq62RPHO1pcJEmNQVABrZIv9KI3l9eESKVc4zU=; 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=n4lildLzoOevDvrcwQ5EZ6ievznAyXDBgGzNmg23NJ/4qEPbGDkfHY9j2zlnM6lEY +V/X2aQvfB30zHsZ3VwovzLZtsrb7Z5Yqr+o8N3acZqlVDz7MF0ImpRyt3+EZcyy+/ 78g/tHW//8BK1aSClUSiLlv+CDseH/eQPV2x5pVw= 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 08E906ECE3 for ; Thu, 30 Jun 2022 15:16:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 08E906ECE3 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1o6t6H-0005jD-DN; Thu, 30 Jun 2022 15:16:49 +0300 Date: Thu, 30 Jun 2022 15:09:38 +0300 To: Sergey Kaplun Message-ID: References: <20211227102524.9410-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211227102524.9410-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9F05DDD76985F9126146A9CA9056EB9C65D59B976056AE7F2182A05F5380850409B769DE9818BB1A6F268F729AD4C8C55B45F958FC9730D0825AD81CFD5A90CE5 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE76D24A1449B9F25A2EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AA32F0A5ADCF96E68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8500789F4331FB6611B879E3E223E2D97117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B8C7ADC89C2F0B2A5A471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CD0F529D6CE73765543847C11F186F3C59DAA53EE0834AAEE X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E14218C6CDE5D1141D2B1CF0FC9FF3B6FB18F8D241EE87DCB229C902535CB1F2709D02AD91A466A1DEF99B296C473AB1E14218B936CB490224F2464EEA7BD89490CAC0EDDA962BC3F61961 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3454548929AF40B4287F35DB0DF138B697C4A51ADABD00A17A8759A35C10750124D2AD545D7F7922DE1D7E09C32AA3244C3DEB980B19061133314251AB5F8D2C8569B6CAE0477E908D927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojhvrbUd41KJkmVOiWz1QIhQ== X-Mailru-Sender: 689FA8AB762F7393CC2E0F076E87284E52E535D3E578E05E78A63C899B0B03B6A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Add stricter check for print() vs. tostring() shortcut. 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 master, 2.10 and 1.10. On 27.12.21, Sergey Kaplun wrote: > From: Mike Pall > > (cherry picked from 46a1b268eb0534182eda0447303c344a071632fe) > > `print()` function uses tostring to convert all incoming values to the > strings. So, if element to convert has `__tostring` metamethod it must > be used. In LuaJIT `print()` base library function has a shortcut to > detect fast path for strings and numbers. This shortcut doesn't check > metatable presence for numbers, so `__tostring` metamethod is ignored. > > This patch adds the corresponding check for metatable on base number > type, when the aforementioned shortcut is set. > > Sergey Kaplun: > * added the description and the test for the problem > > Part of tarantool/tarantool#6548 > --- > > Issue: https://github.com/tarantool/tarantool/issues/6548 > Related issue: https://github.com/tarantool/tarantool/issues/6746 > > Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-noticket-print-tostring-number-mt-full-ci > Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-noticket-print-tostring-number-mt-full-ci > > CI is red due to integration tests failes (same as on master) or due to > connection errors. > > src/lib_base.c | 3 +- > .../print-tostring-number.test.lua | 45 +++++++++++++++++++ > 2 files changed, 47 insertions(+), 1 deletion(-) > create mode 100644 test/tarantool-tests/print-tostring-number.test.lua > > -- > 2.34.1 > -- Best regards, IM