forked from aniani/vim
patch 8.2.5006: asan warns for undefined behavior
Problem: Asan warns for undefined behavior. Solution: Cast the shifted value to unsigned.
This commit is contained in:
@@ -4091,7 +4091,7 @@ exec_instructions(ectx_T *ectx)
|
||||
case EXPR_LSHIFT: if (arg2 > MAX_LSHIFT_BITS)
|
||||
res = 0;
|
||||
else
|
||||
res = arg1 << arg2;
|
||||
res = (uvarnumber_T)arg1 << arg2;
|
||||
break;
|
||||
case EXPR_RSHIFT: if (arg2 > MAX_LSHIFT_BITS)
|
||||
res = 0;
|
||||
|
Reference in New Issue
Block a user