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 9047F6ECE4; Thu, 30 Jun 2022 15:17:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9047F6ECE4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1656591441; bh=GXbk1W/zs0pUeJklgOBI/8JGYEG6xp/jw+p0xazQigw=; 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=bV1etdB7YppSqVFbXlXTD6rP4a5RfqMdKJe5ffPWV3rJSESkWUTqnqLMZyGM5S+Va bHcs2eGO/01jxugaRfkX2Wb7CI/OJzEaMpCyVIDPzBL0zFewXkooyhed2hofyQmP05 8qQwZDFiDiyyhYBTPZye6or0crsjZ0rsYqP+fT6w= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (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 8898B6ECE4 for ; Thu, 30 Jun 2022 15:16:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8898B6ECE4 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1o6t6Q-0006m8-NQ; Thu, 30 Jun 2022 15:16:59 +0300 Date: Thu, 30 Jun 2022 15:09:47 +0300 To: Sergey Kaplun Message-ID: References: <20211227134237.2942-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211227134237.2942-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9F05DDD76985F9126CE96500E2092A7EDF346B8EE03F8ED51182A05F538085040B7AD05B3E1CD2D8F7CF49E6B9B84AD06314EDEEBC73824D8EF77F9D91DEC2A30 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71BDE6A359BD5B800EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CE17C7754E00FC028638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D823EA9E3F680379B421AAF7090F9F0ED8117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B60CDF180582EB8FBA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CD0F529D6CE73765543847C11F186F3C59DAA53EE0834AAEE X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E14218C6CDE5D1141D2B1CF0FC9FF3B6FB18F8B55970CC9F4085E2A30A42C0DBD2D8D1AD91A466A1DEF99B296C473AB1E14218B936CB490224F2464EEA7BD89490CAC0EDDA962BC3F61961 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34047E322BFAFD69BD564E78850D620F716FFD6D0CBDDC5DB3A1256CE14A970C7F58B8E4BF37A311311D7E09C32AA3244C6BDA75278D804DE0E4EBC3385D27C6B13FD9C8CA1B0515E0927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojhvrbUd41KJm2VZYxDcBy1w== X-Mailru-Sender: 689FA8AB762F7393CC2E0F076E87284E1EDC8CD37EC853C0D8376099425BB6A5A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Give expected results for negative non-base-10 numbers in tonumber(). 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 > > This was undefined in Lua 5.1, but it's defined in 5.2. > > (cherry picked from f3cf0d6e15240098147437fed7bd436ff55fdf8c) > > `strtoul()` considers negative values as a valid input and silently > converts them to the equivalent unsigned long value. As a result yielded > value is unexpected to the user. > > This patch adds reading of a sign (if exists) from argument and provide > the remaining part of the string as is if it starts with a digit or > alphabetical symbol to be consistent with Lua 5.2. > > Sergey Kaplun: > * added the description and the test for the problem > > Part of tarantool/tarantool#6548 > --- > > Issue: https://github.com/tarantool/tarantool/issues/6548 > Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-noticket-tonumber-expected-results-full-ci > Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-noticket-tonumber-expected-results-full-ci > > CI is red due to integration tests failes (same as on master) or due to > connection errors. > > Side note: I suppose that undefinence Mike talking about is the > following lines in the Lua 5.1 Reference manual [1]: > > | In base 10 (the default), the number can have a decimal part, as well > | as an optional exponent part (see paragraph 2.1). In other bases, only > | unsigned integers are accepted. > > In the Lua 5.2 Reference manual [2] they are deleted. > > src/lib_base.c | 27 +++++++++++------ > ...onumber-negative-non-decimal-base.test.lua | 29 +++++++++++++++++++ > 2 files changed, 47 insertions(+), 9 deletions(-) > create mode 100644 test/tarantool-tests/tonumber-negative-non-decimal-base.test.lua > > -- > 2.34.1 > > [1]: http://www.lua.org/manual/5.1/manual.html#pdf-tonumber > [2]: http://www.lua.org/manual/5.2/manual.html#pdf-tonumber -- Best regards, IM