]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: Restore $((x)) error checking after fix for $((-9223372036854775808))
authorjilles <jilles@FreeBSD.org>
Sun, 10 Feb 2019 22:23:05 +0000 (22:23 +0000)
committerjilles <jilles@FreeBSD.org>
Sun, 10 Feb 2019 22:23:05 +0000 (22:23 +0000)
commitbdbf8ff3c037e3ea0af749f43843000f2a9a88ed
tree1151ffbe371a28cf932a79a8fa5e1934769b5385
parentc7579373163a6e595789d8042113c1e880137e83
sh: Restore $((x)) error checking after fix for $((-9223372036854775808))

SVN r342880 was designed to fix $((-9223372036854775808)) and things like
$((0x8000000000000000)) but also broke error detection for values of
variables without dollar sign ($((x))).

For compatibility, overflow in plain literals continues to be ignored and
the value is clamped to the boundary (except 9223372036854775808 which is
changed to -9223372036854775808).

Reviewed by: se (although he would like error checking to be removed)
MFC after: 2 weeks
X-MFC-with: r342880
Differential Revision: https://reviews.freebsd.org/D18926
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/arith16.0 [new file with mode: 0644]
bin/sh/tests/expansion/arith17.0 [new file with mode: 0644]