sh: Avoid undefined behaviour shifting negative values left in arithmetic.
With i386 base clang, arith_yacc.o remains unchanged.
This commit is contained in:
parent
dd5a01badc
commit
b0762e4921
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266947
@ -139,7 +139,7 @@ static arith_t do_binop(int op, arith_t a, arith_t b)
|
||||
case ARITH_SUB:
|
||||
return (uintmax_t)a - (uintmax_t)b;
|
||||
case ARITH_LSHIFT:
|
||||
return a << b;
|
||||
return (uintmax_t)a << b;
|
||||
case ARITH_RSHIFT:
|
||||
return a >> b;
|
||||
case ARITH_LT:
|
||||
|
Loading…
Reference in New Issue
Block a user