mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.5004: right shift on negative number does not work as documented
Problem: Right shift on negative number does not work as documented. Solution: Use a uvarnumber_T type cast.
This commit is contained in:
@@ -4096,12 +4096,7 @@ exec_instructions(ectx_T *ectx)
|
||||
case EXPR_RSHIFT: if (arg2 > MAX_LSHIFT_BITS)
|
||||
res = 0;
|
||||
else
|
||||
{
|
||||
res = arg1 >> arg2;
|
||||
// clear the topmost sign bit
|
||||
res &= ~((uvarnumber_T)1
|
||||
<< MAX_LSHIFT_BITS);
|
||||
}
|
||||
res = (uvarnumber_T)arg1 >> arg2;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user