summaryrefslogtreecommitdiffstats
path: root/src/macros.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-07 20:59:34 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-07 20:59:34 +0100
commite31ee86859528a7ffe00405645547d494e522fa8 (patch)
tree741c24aea3fae5efb613d64314a6721d6cad85c5 /src/macros.h
parentce6db0273f2c4359f48d75103a42991aa481f14e (diff)
patch 8.2.0098: exe stack length can be wrong without being detectedv8.2.0098
Problem: Exe stack length can be wrong without being detected. Solution: Add a check when ABORT_ON_INTERNAL_ERROR is defined.
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/macros.h b/src/macros.h
index ca7e4b5d0b..455705ca4f 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -344,3 +344,15 @@
#else
# define ERROR_IF_POPUP_WINDOW 0
#endif
+
+
+#ifdef ABORT_ON_INTERNAL_ERROR
+# define ESTACK_CHECK_DECLARATION int estack_len_before;
+# 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);
+#else
+# define ESTACK_CHECK_DECLARATION
+# define ESTACK_CHECK_SETUP
+# define ESTACK_CHECK_NOW
+#endif