mirror of
https://github.com/neovim/neovim.git
synced 2025-09-25 04:28:33 +00:00
Add assertions for watchers
The clang static analyzer convinced itself lp->ll_newkey could be NULL. This adds an assertion that checks this doesn't actually happen, as well as a parallel assertion for di->di_key.
This commit is contained in:
@@ -2480,9 +2480,11 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv,
|
||||
notify:
|
||||
if (watched) {
|
||||
if (oldtv.v_type == VAR_UNKNOWN) {
|
||||
assert(lp->ll_newkey != NULL);
|
||||
tv_dict_watcher_notify(dict, (char *)lp->ll_newkey, lp->ll_tv, NULL);
|
||||
} else {
|
||||
dictitem_T *di = lp->ll_di;
|
||||
assert(di->di_key != NULL);
|
||||
tv_dict_watcher_notify(dict, (char *)di->di_key, lp->ll_tv, &oldtv);
|
||||
tv_clear(&oldtv);
|
||||
}
|
||||
|
Reference in New Issue
Block a user