vim-patch:9.1.1611: possible undefined behaviour in mb_decompose() (#35275)

Problem:  possible undefined behaviour in mb_decompose(), when using the
          same pointer as argument several times
Solution: use separate assignments to avoid reading and writing the same
          object at the same time (Áron Hárnási)

closes: vim/vim#17953

c43a0614d4

Co-authored-by: Áron Hárnási <aron.harnasi@gmail.com>
(cherry picked from commit 77500c5ad5)
This commit is contained in:
zeertzjq
2025-08-10 07:23:59 +08:00
committed by github-actions[bot]
parent bd4b45dd1b
commit d21db345ef

View File

@@ -1727,7 +1727,8 @@ static void mb_decompose(int c, int *c1, int *c2, int *c3)
*c3 = d.c;
} else {
*c1 = c;
*c2 = *c3 = 0;
*c2 = 0;
*c3 = 0;
}
}