summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-25 13:39:28 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-25 13:39:28 +0000
commit0bd8d0563853ab821a018fb9cdd85f674684fe57 (patch)
tree8c8f0c4b1fec95272e1977ddf73715c9a63ba5e8
parent71b36206be14c3b6334765d44a38d413eca751c7 (diff)
downloadvim-git-0bd8d0563853ab821a018fb9cdd85f674684fe57.tar.gz
patch 8.2.3673: crash when allocating signal stack failsv8.2.3673
Problem: Crash when allocating signal stack fails. Solution: Only using sourcing info when available. (closes #9215)
-rw-r--r--src/globals.h1
-rw-r--r--src/message.c4
-rw-r--r--src/version.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/globals.h b/src/globals.h
index 90998d875..8f4f5a575 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -288,6 +288,7 @@ EXTERN int msg_no_more INIT(= FALSE); // don't use more prompt, truncate
* Current context is at ga_len - 1.
*/
EXTERN garray_T exestack INIT5(0, 0, sizeof(estack_T), 50, NULL);
+#define HAVE_SOURCING_INFO (exestack.ga_data != NULL && exestack.ga_len > 0)
// name of error message source
#define SOURCING_NAME (((estack_T *)exestack.ga_data)[exestack.ga_len - 1].es_name)
// line number in the message source or zero
diff --git a/src/message.c b/src/message.c
index 0cd09da9f..e438211fa 100644
--- a/src/message.c
+++ b/src/message.c
@@ -446,7 +446,7 @@ reset_last_sourcing(void)
static int
other_sourcing_name(void)
{
- if (SOURCING_NAME != NULL)
+ if (HAVE_SOURCING_INFO && SOURCING_NAME != NULL)
{
if (last_sourcing_name != NULL)
return STRCMP(SOURCING_NAME, last_sourcing_name) != 0;
@@ -465,7 +465,7 @@ get_emsg_source(void)
{
char_u *Buf, *p;
- if (SOURCING_NAME != NULL && other_sourcing_name())
+ if (HAVE_SOURCING_INFO && SOURCING_NAME != NULL && other_sourcing_name())
{
char_u *sname = estack_sfile(ESTACK_NONE);
char_u *tofree = sname;
diff --git a/src/version.c b/src/version.c
index d1004bb1e..3f8310373 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3673,
+/**/
3672,
/**/
3671,