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 7EE0D5B85FB; Fri, 25 Aug 2023 15:05:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7EE0D5B85FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1692965146; bh=dLxwSiFoibMAv4qAyFzZQt57u1IBXpwcM4yV6bhCD5s=; 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=yEUtehG6/CttC6gcuzQQPWywSpEc/HogV6nN5BFfpqKU+8R7AV4NdDZ2FgpYX9+cy RNPXDnN9gdjTPJoIRZe993q9llWNUrONqvFqfxh1un0X3ETRT+H/zwj/cMR0GVRJDE w1i2g6tIKAxHd+8oiwl5OFT6lX6bQ4Efn7qaJajw= Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [95.163.41.78]) (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 AA22B5B7CC5 for ; Fri, 25 Aug 2023 15:05:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AA22B5B7CC5 Received: by smtp37.i.mail.ru with esmtpa (envelope-from ) id 1qZVZQ-005oMF-1X; Fri, 25 Aug 2023 15:05:44 +0300 Date: Fri, 25 Aug 2023 15:01:00 +0300 To: Maxim Kokryashkin Message-ID: References: <20230824100233.25009-1-skaplun@tarantool.org> <1692958322.194384889@f490.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1692958322.194384889@f490.i.mail.ru> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD93A57780790C03AB45CA4A24C85ACA40990CF4975E3760D1F182A05F5380850404C228DA9ACA6FE27F8C4A5CC7A2F07586B2931C99969765B3636D5261F6C3181C27E450A73977F31 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78981306C6E927004EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637DB576DCB83B448D28638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8906B1899EB2B94218BAD5AB467DBEB16117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC93A51A5089774A2DA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD1828451B159A507268D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE4B6963042765DA4BE2071C6999E77799D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE34B6F6234D9065C97C0837EA9F3D19764C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F790063710A74FE5B09D3CF8731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A52F9F9755AA6430A03326944AC8FBE7C758D8DE786FBC178DF87CCE6106E1FC07E67D4AC08A07B9B0735DFC8FA7AC1207CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34980A6B448CFD1B8ADCC8FF2A7F64D3ED972EB6DFE71A5646E022FCBEAEC757210C48CD1B424F9BD31D7E09C32AA3244C8D6FFB268E933E292085EDF1AC237CEA30452B15D76AEC1485A42E4C463514DC5DA084F8E80FEBD3202CD0F03380D9577A83BD0C44CE203720ABEDE4BBDD9CDD X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyVV/YwCnDiS4Pvlkx9UpfQ== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A7691391911CD19996B16B2931C99969765B8FF8BC079CCEBBDCDEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix binary number literal parsing. 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: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Maxim! Thanks for the review! Fixed your comments inline, rebased branch on the current master and force-pushed it. On 25.08.23, Maxim Kokryashkin wrote: > > Hi, Sergey! > Thanks for the patch! > LGTM, except for a few comments below. > >  > >>From: Mike Pall > >> > >>Reported by Egor Skriptunoff. > >> > >>(cherry-picked from commit 377a8488b62a9f1b589bb68875dd1288aa70e76e) > >> > >>Binary number with fractional part is invalid. Parsing of such binary > >Typo: s/Binary/ A binary/ > >Typo: s/fractional/a fractional/ Fixed. > >>numbers returns `STRSCAN_ERROR` for any numbers with non-zero fractional > >Typo: s/with/with a/ Fixed. > >>part, because it gives non-zero power of the exponent (`ex2`) in > >Typo: s/part,/part/ Fixed. > >Typo: s/non-zero/a non-zero/ Fixed. > >>`strscan_bin()`. But binary numbers with a zero fractional part > >>considered as valid numbers. To avoid such inconsistency the check, that > >Typo: s/considered as/are considered/ Fixed, thanks. > >>the given base doesn't equal 2, is added, when parsing decimal point > >Typo: s/parsing/parsing the/ Fixed. > >>part of the literal. > >> > >>Sergey Kaplun: > >>* added the description and the test for the problem > >> > >>Part of tarantool/tarantool#8825 > >>--- > >>+ > >>+-- Test that incorrect literal with non-0 fractional part still > >Typo: s/that/that an/ > >Typo: s/with/with a/ Fixed. > >>+-- can't be converted to number. > >Typo: s/number/a number/ Fixed. > >>+test:is(tonumber('0b.1'), nil, '0b.1 is not converted') > >>+-- Test that incorrect literal with 0 fractional part can't be > >Typo: s/that/that an/ Fixed. > >>+-- converted to number. > >Typo: s/number/a number/ Fixed. See the iterative diff below: =================================================================== diff --git a/test/tarantool-tests/fix-binary-number-parsing.test.lua b/test/tarantool-tests/fix-binary-number-parsing.test.lua index df82bd0b..9f149082 100644 --- a/test/tarantool-tests/fix-binary-number-parsing.test.lua +++ b/test/tarantool-tests/fix-binary-number-parsing.test.lua @@ -7,11 +7,11 @@ local tap = require('tap') local test = tap.test('fix-binary-number-parsing') test:plan(2) --- Test that incorrect literal with non-0 fractional part still --- can't be converted to number. +-- Test that an incorrect literal with a non-0 fractional part +-- still can't be converted to a number. test:is(tonumber('0b.1'), nil, '0b.1 is not converted') --- Test that incorrect literal with 0 fractional part can't be --- converted to number. +-- Test that an incorrect literal with 0 fractional part can't be +-- converted to a number. test:is(tonumber('0b.0'), nil, '0b.0 is not converted') test:done(true) =================================================================== > >>+test:is(tonumber('0b.0'), nil, '0b.0 is not converted') > >>+ > >>+test:done(true) > >>-- > >>2.41.0 > >-- > >Best regards, > >Maxim Kokryashkin > >  -- Best regards, Sergey Kaplun