summaryrefslogtreecommitdiff
path: root/src/macros.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-03-11 14:19:58 +0100
committerBram Moolenaar <Bram@vim.org>2020-03-11 14:19:58 +0100
commitcee52204ca030ce7814844e4dab8b4ed897ba3cc (patch)
treeecaed340ef62e0b346a7592cc5876f31e1b77f14 /src/macros.h
parente49b4bb89505fad28cf89f0891aef3e2d397919e (diff)
downloadvim-git-8.2.0371.tar.gz
patch 8.2.0371: crash with combination of terminal popup and autocmdv8.2.0371
Problem: Crash with combination of terminal popup and autocmd. Solution: Disallow closing a popup that is the current window. Add a check that the current buffer is valid. (closes #5754)
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/macros.h b/src/macros.h
index a7964d850..803b89115 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -364,8 +364,11 @@
# define ESTACK_CHECK_SETUP estack_len_before = exestack.ga_len;
# define ESTACK_CHECK_NOW if (estack_len_before != exestack.ga_len) \
siemsg("Exestack length expected: %d, actual: %d", estack_len_before, exestack.ga_len);
+# define CHECK_CURBUF if (curwin != NULL && curwin->w_buffer != curbuf) \
+ iemsg("curbuf != curwin->w_buffer")
#else
# define ESTACK_CHECK_DECLARATION
# define ESTACK_CHECK_SETUP
# define ESTACK_CHECK_NOW
+# define CHECK_CURBUF
#endif