• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisionf46d3a9fe27d85ccbbec167659901a6554efb6ab (tree)
Time2020-03-27 00:15:03
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.0452: channel_parse_messages() fails when called recursively

Commit: https://github.com/vim/vim/commit/a9c3a30891edd7347d94298c48ea68bb5c165fd7
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 26 16:03:45 2020 +0100

patch 8.2.0452: channel_parse_messages() fails when called recursively
Problem: channel_parse_messages() fails when called recursively.
Solution: Return for a recursive call. (closes https://github.com/vim/vim/issues/5835)

Change Summary

Incremental Difference

diff -r db735aadbcc2 -r f46d3a9fe27d src/channel.c
--- a/src/channel.c Thu Mar 26 15:45:04 2020 +0100
+++ b/src/channel.c Thu Mar 26 16:15:03 2020 +0100
@@ -4428,14 +4428,22 @@
44284428 int ret = FALSE;
44294429 int r;
44304430 ch_part_T part = PART_SOCK;
4431+ static int recursive = FALSE;
44314432 #ifdef ELAPSED_FUNC
44324433 elapsed_T start_tv;
4433-
4434+#endif
4435+
4436+ // The code below may invoke callbacks, which might call us back.
4437+ // That doesn't work well, just return without doing anything.
4438+ if (recursive)
4439+ return FALSE;
4440+ recursive = TRUE;
4441+ ++safe_to_invoke_callback;
4442+
4443+#ifdef ELAPSED_FUNC
44344444 ELAPSED_INIT(start_tv);
44354445 #endif
44364446
4437- ++safe_to_invoke_callback;
4438-
44394447 // Only do this message when another message was given, otherwise we get
44404448 // lots of them.
44414449 if ((did_repeated_msg & REPEATED_MSG_LOOKING) == 0)
@@ -4513,6 +4521,7 @@
45134521 }
45144522
45154523 --safe_to_invoke_callback;
4524+ recursive = FALSE;
45164525
45174526 return ret;
45184527 }
diff -r db735aadbcc2 -r f46d3a9fe27d src/version.c
--- a/src/version.c Thu Mar 26 15:45:04 2020 +0100
+++ b/src/version.c Thu Mar 26 16:15:03 2020 +0100
@@ -739,6 +739,8 @@
739739 static int included_patches[] =
740740 { /* Add new patch number below this line */
741741 /**/
742+ 452,
743+/**/
742744 451,
743745 /**/
744746 450,
Show on old repository browser