commit 869e55f2aacdc986a51f0bb683f11dcf0c464e98
parent be73c35943f85e7835c3a0fc89bddaeba944db29
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon, 20 Oct 2025 12:24:46 +0800
Merge pull request #36253 from janlazo/vim-9.0.1033
vim-patch:8.2.3673,9.0.{433,1033}
Diffstat:
5 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
@@ -1378,7 +1378,7 @@ static char *get_lval_subscript(lval_T *lp, char *p, char *name, typval_T *rettv
return NULL;
}
- // a NULL list/blob works like an empty list/blob, allocate one now.
+ // A NULL list/blob works like an empty list/blob, allocate one now.
if (lp->ll_tv->v_type == VAR_LIST && lp->ll_tv->vval.v_list == NULL) {
tv_list_alloc_ret(lp->ll_tv, kListLenUnknown);
} else if (lp->ll_tv->v_type == VAR_BLOB && lp->ll_tv->vval.v_blob == NULL) {
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c
@@ -3341,7 +3341,7 @@ void tv_dict_remove(typval_T *argvars, typval_T *rettv, const char *arg_errmsg)
///
/// @param[out] ret_tv Structure where blob is saved.
blob_T *tv_blob_alloc_ret(typval_T *const ret_tv)
- FUNC_ATTR_NONNULL_ALL
+ FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET
{
blob_T *const b = tv_blob_alloc();
tv_blob_set_ret(ret_tv, b);
diff --git a/src/nvim/eval/typval_defs.h b/src/nvim/eval/typval_defs.h
@@ -53,7 +53,7 @@ typedef struct dictvar_S dict_T;
typedef struct partial_S partial_T;
typedef struct blobvar_S blob_T;
-typedef struct ufunc ufunc_T;
+typedef struct ufunc_S ufunc_T;
typedef enum {
kCallbackNone = 0,
@@ -321,7 +321,7 @@ struct funccall_S {
};
/// Structure to hold info for a user function.
-struct ufunc {
+struct ufunc_S {
int uf_varargs; ///< variable nr of arguments
int uf_flags;
int uf_calls; ///< nr of active calls
diff --git a/src/nvim/message.c b/src/nvim/message.c
@@ -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;
diff --git a/src/nvim/runtime.h b/src/nvim/runtime.h
@@ -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