]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r342880,r343981,r344902: sh: Fix $((-9223372036854775808))
authorJilles Tjoelker <jilles@FreeBSD.org>
Wed, 13 Mar 2019 21:53:10 +0000 (21:53 +0000)
committerJilles Tjoelker <jilles@FreeBSD.org>
Wed, 13 Mar 2019 21:53:10 +0000 (21:53 +0000)
commitb56d524da406e3b0778a832aaf78fe24de9cf44e
treeb3adf2d140b1742f2777cdbefd81c4d67c722ffb
parent05b9fb01152fa22502c7784070602002180de97e
MFC r342880,r343981,r344902: sh: Fix $((-9223372036854775808))

Since $((9223372036854775808)) overflows, $((-9223372036854775808)) was not
parsed correctly (with x=-9223372036854775808, $((x)) already worked, since
that parses the value with the minus sign in one step). Values further from
zero are still clamped to 9223372036854775807.

Also, allow the full 64 bits in octal and hexadecimal.
bin/sh/arith_yacc.c
bin/sh/arith_yacc.h
bin/sh/arith_yylex.c
bin/sh/shell.h
bin/sh/tests/expansion/Makefile
bin/sh/tests/expansion/arith15.0 [new file with mode: 0644]
bin/sh/tests/expansion/arith16.0 [new file with mode: 0644]
bin/sh/tests/expansion/arith17.0 [new file with mode: 0644]