diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-05-22 22:07:52 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-22 22:07:52 +0100 |
commit | 68e64d2c1735f2a39afa8a0475ae29bedb116684 (patch) | |
tree | fc30407cfebef2a874ca6a83f4351ceef025d657 /src/eval.c | |
parent | 5b529230f144028b67ed1d59207af098c18a1858 (diff) |
patch 8.2.5006: asan warns for undefined behaviorv8.2.5006
Problem: Asan warns for undefined behavior.
Solution: Cast the shifted value to unsigned.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 7f90954667..1aa0eaec75 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3089,7 +3089,7 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg) rettv->vval.v_number = 0; else if (type == EXPR_LSHIFT) rettv->vval.v_number = - rettv->vval.v_number << var2.vval.v_number; + (uvarnumber_T)rettv->vval.v_number << var2.vval.v_number; else rettv->vval.v_number = (uvarnumber_T)rettv->vval.v_number >> var2.vval.v_number; |