mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Fix warnings: edit.c: ins_bs(): Garbage result: MI.
Problem : Result of operation is garbage or undefined @ 7460. Diagnostic : Multithreading issue. Rationale : Problem occurs if any of globals `enc_utf8`, `p_deco is modified while function is executing. Resolution : Use local copy of globals.
This commit is contained in:
parent
d0a0efaf32
commit
74817b546e
@ -7455,7 +7455,9 @@ static int ins_bs(int c, int mode, int *inserted_space_p)
|
|||||||
if (State & REPLACE_FLAG)
|
if (State & REPLACE_FLAG)
|
||||||
replace_do_bs(-1);
|
replace_do_bs(-1);
|
||||||
else {
|
else {
|
||||||
if (enc_utf8 && p_deco)
|
const bool l_enc_utf8 = enc_utf8;
|
||||||
|
const int l_p_deco = p_deco;
|
||||||
|
if (l_enc_utf8 && l_p_deco)
|
||||||
(void)utfc_ptr2char(get_cursor_pos_ptr(), cpc);
|
(void)utfc_ptr2char(get_cursor_pos_ptr(), cpc);
|
||||||
(void)del_char(FALSE);
|
(void)del_char(FALSE);
|
||||||
/*
|
/*
|
||||||
@ -7463,7 +7465,7 @@ static int ins_bs(int c, int mode, int *inserted_space_p)
|
|||||||
* move the cursor back. Don't back up before the base
|
* move the cursor back. Don't back up before the base
|
||||||
* character.
|
* character.
|
||||||
*/
|
*/
|
||||||
if (enc_utf8 && p_deco && cpc[0] != NUL)
|
if (l_enc_utf8 && l_p_deco && cpc[0] != NUL)
|
||||||
inc_cursor();
|
inc_cursor();
|
||||||
if (revins_chars) {
|
if (revins_chars) {
|
||||||
revins_chars--;
|
revins_chars--;
|
||||||
|
Loading…
Reference in New Issue
Block a user