push
github
Fix binary number literal parsing. Reported by Egor Skriptunoff. (cherry-picked from commit 377a8488b) A binary number with a fractional part is invalid. Parsing of such binary numbers returns `STRSCAN_ERROR` for any numbers with a non-zero fractional part because it gives a non-zero power of the exponent (`ex2`) in `strscan_bin()`. But binary numbers with a zero fractional part are considered valid numbers. To avoid such inconsistency the check, that the given base doesn't equal 2, is added, when parsing the decimal point part of the literal. Sergey Kaplun: * added the description and the test for the problem Part of tarantool/tarantool#8825 Reviewed-by: Maxim Kokryashkin <m.kokryashkin@tarantool.org> Reviewed-by: Sergey Bronnikov <sergeyb@tarantool.org> Signed-off-by: Igor Munkin <imun@tarantool.org>
5326 of 5967 branches covered (0.0%)
Branch coverage included in aggregate %.
1 of 1 new or added line in 1 file covered. (100.0%)
20410 of 23283 relevant lines covered (87.66%)
1295920.8 hits per line