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 CDB6F6ECE3; Tue, 28 Jun 2022 00:05:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CDB6F6ECE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1656363945; bh=fyEuJvXum6BVSwrk2tHeYwlYo0yU4gCY77cDk9dykTk=; 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=dtDihBLiMXKU3aUxC1nbtjqIxgDtJzxLXAvpg4FEZTPRU5sfQbSXDVWImjz8A6lJ4 xbvgVdv/Cz7Cr0+gojEeEv5tv7lQ6jC/W0fRD9aLiad+v+F1oTYGsgowf/+yqAGiFd PQkl4VqGXgcjSGg7AQOdmw/3vKH/Z8QF5vgf0VdE= 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 D1C4D6ECE3 for ; Tue, 28 Jun 2022 00:05:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D1C4D6ECE3 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1o5vvS-0002wY-Uz; Tue, 28 Jun 2022 00:05:43 +0300 Date: Mon, 27 Jun 2022 23:58:32 +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-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD921FF253C2DCA643281118965E48D7E4D06C6C4839B6ACAB000894C459B0CD1B967C17FEC1C226DD74E31DFACAE4897A27F735B3764D45A480A717E8548925757 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B264C8851FD8E810EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375D54B99ECAFA2F678638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D80377FE481CA96DE12508E8B3825271E0117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3EAA04613575FAEBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BB662CFBDBA8F60F475ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 0D63561A33F958A5488E62BAAA6A93A955DF04BFCD7F535CA36968FD2A5F8B7CD59269BC5F550898D99A6476B3ADF6B4886A5961035A09600383DAD389E261318FB05168BE4CE3AF X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C264B329661203DA1FF9D0374CD91F02A6BC0DA7AD9004B817271FB7C2C166AD5688886662BFD2E81D7E09C32AA3244C5C7AF6971839D802AAA94DCF70CC500F8580396430872480927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj8L65zF8kk4eRt1QhiVVWUQ== X-Mailru-Sender: 689FA8AB762F7393CC2E0F076E87284E1FD806A306081D8D488ED9CB834A9504A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 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, Thanks for the patch! LGTM, except a single nit I've fixed by myself. 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 Typo: s/provide/provides/. > 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