diff options
author | ZyX <kp-pav@yandex.ru> | 2017-03-05 02:15:17 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:08:45 +0300 |
commit | 38dd81c136c2edbda66614622a4747bf1785af94 (patch) | |
tree | e1b16bc84bb67a2a1d0a81857e91df83a7260705 /src | |
parent | faddd83db8a71623e78a4d919b2bb55e6a58439d (diff) | |
download | rneovim-38dd81c136c2edbda66614622a4747bf1785af94.tar.gz rneovim-38dd81c136c2edbda66614622a4747bf1785af94.tar.bz2 rneovim-38dd81c136c2edbda66614622a4747bf1785af94.zip |
eval/typval: Fix SEGV in test_alot.vim test
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval/typval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 326334f149..8d1ecf8f14 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1167,8 +1167,11 @@ void tv_dict_unref(dict_T *const d) /// @return found item or NULL if nothing was found. dictitem_T *tv_dict_find(const dict_T *const d, const char *const key, const ptrdiff_t len) - FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT + FUNC_ATTR_NONNULL_ARG(2) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { + if (d == NULL) { + return NULL; + } hashitem_T *const hi = (len < 0 ? hash_find(&d->dv_hashtab, (const char_u *)key) : hash_find_len(&d->dv_hashtab, key, (size_t)len)); |