diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-03-09 19:44:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-09 19:44:26 -0500 |
commit | cc23c95bccda06c9bbcadd919f4fb2f2545f1151 (patch) | |
tree | 5eb6745f2bd2723e1cca4f6f0d18d494c309aac9 /src/nvim/eval.c | |
parent | e355cc8cc5c131e6df429107f321dd4a80c05065 (diff) | |
parent | 7da8056607331f12b912b4a7c65592ac317c2ff4 (diff) | |
download | rneovim-cc23c95bccda06c9bbcadd919f4fb2f2545f1151.tar.gz rneovim-cc23c95bccda06c9bbcadd919f4fb2f2545f1151.tar.bz2 rneovim-cc23c95bccda06c9bbcadd919f4fb2f2545f1151.zip |
Merge pull request #14088 from janlazo/vim-8.2.2577
vim-patch:8.1.0783,8.2.{1507,2152,2438,2577}
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 6d97310c1c..63d5216cc4 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -5280,14 +5280,10 @@ bool set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, if (ht_stack == NULL) { abort = set_ref_in_ht(&dd->dv_hashtab, copyID, list_stack); } else { - ht_stack_T *newitem = try_malloc(sizeof(ht_stack_T)); - if (newitem == NULL) { - abort = true; - } else { - newitem->ht = &dd->dv_hashtab; - newitem->prev = *ht_stack; - *ht_stack = newitem; - } + ht_stack_T *const newitem = xmalloc(sizeof(ht_stack_T)); + newitem->ht = &dd->dv_hashtab; + newitem->prev = *ht_stack; + *ht_stack = newitem; } QUEUE *w = NULL; @@ -5308,14 +5304,10 @@ bool set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, if (list_stack == NULL) { abort = set_ref_in_list(ll, copyID, ht_stack); } else { - list_stack_T *newitem = try_malloc(sizeof(list_stack_T)); - if (newitem == NULL) { - abort = true; - } else { - newitem->list = ll; - newitem->prev = *list_stack; - *list_stack = newitem; - } + list_stack_T *const newitem = xmalloc(sizeof(list_stack_T)); + newitem->list = ll; + newitem->prev = *list_stack; + *list_stack = newitem; } } break; |