mirror of
https://github.com/neovim/neovim.git
synced 2026-03-30 20:32:08 +00:00
vim-patch:8.2.3673: crash when allocating signal stack fails
Problem: Crash when allocating signal stack fails.
Solution: Only using sourcing info when available. (closes vim/vim#9215)
0bd8d05638
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -643,7 +643,7 @@ void reset_last_sourcing(void)
|
||||
/// @return true if "SOURCING_NAME" differs from "last_sourcing_name".
|
||||
static bool 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;
|
||||
}
|
||||
@@ -659,7 +659,7 @@ static bool other_sourcing_name(void)
|
||||
static char *get_emsg_source(void)
|
||||
FUNC_ATTR_MALLOC FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
if (SOURCING_NAME != NULL && other_sourcing_name()) {
|
||||
if (HAVE_SOURCING_INFO && SOURCING_NAME != NULL && other_sourcing_name()) {
|
||||
char *sname = estack_sfile(ESTACK_NONE);
|
||||
char *tofree = sname;
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
/// Stack of execution contexts. Each entry is an estack_T.
|
||||
/// Current context is at ga_len - 1.
|
||||
extern garray_T exestack;
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user