mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 07:16:09 +00:00
gcc/analyzer: fix false positives for NULL (#13248)
Close https://github.com/neovim/neovim/issues/13158
This commit is contained in:
@@ -2687,6 +2687,9 @@ void nvim__screenshot(String path)
|
||||
|
||||
static void clear_provider(DecorProvider *p)
|
||||
{
|
||||
if (p == NULL) {
|
||||
return;
|
||||
}
|
||||
NLUA_CLEAR_REF(p->redraw_start);
|
||||
NLUA_CLEAR_REF(p->redraw_buf);
|
||||
NLUA_CLEAR_REF(p->redraw_win);
|
||||
|
@@ -159,8 +159,11 @@ static int conv_error(const char *const msg, const MPConvStack *const mpstack,
|
||||
vim_snprintf((char *)IObuff, IOSIZE, idx_msg, idx);
|
||||
ga_concat(&msg_ga, IObuff);
|
||||
} else {
|
||||
typval_T key_tv = *TV_LIST_ITEM_TV(
|
||||
tv_list_first(TV_LIST_ITEM_TV(li)->vval.v_list));
|
||||
assert(li != NULL);
|
||||
listitem_T *const first_item =
|
||||
tv_list_first(TV_LIST_ITEM_TV(li)->vval.v_list);
|
||||
assert(first_item != NULL);
|
||||
typval_T key_tv = *TV_LIST_ITEM_TV(first_item);
|
||||
char *const key = encode_tv2echo(&key_tv, NULL);
|
||||
vim_snprintf((char *) IObuff, IOSIZE, key_pair_msg, key, idx);
|
||||
xfree(key);
|
||||
|
@@ -3451,13 +3451,13 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout,
|
||||
|
||||
sub_firstline = NULL;
|
||||
|
||||
/*
|
||||
* ~ in the substitute pattern is replaced with the old pattern.
|
||||
* We do it here once to avoid it to be replaced over and over again.
|
||||
* But don't do it when it starts with "\=", then it's an expression.
|
||||
*/
|
||||
if (!(sub[0] == '\\' && sub[1] == '='))
|
||||
// ~ in the substitute pattern is replaced with the old pattern.
|
||||
// We do it here once to avoid it to be replaced over and over again.
|
||||
// But don't do it when it starts with "\=", then it's an expression.
|
||||
assert(sub != NULL);
|
||||
if (!(sub[0] == '\\' && sub[1] == '=')) {
|
||||
sub = regtilde(sub, p_magic);
|
||||
}
|
||||
|
||||
// Check for a match on each line.
|
||||
// If preview: limit to max('cmdwinheight', viewport).
|
||||
|
@@ -74,6 +74,7 @@ uint64_t extmark_set(buf_T *buf, uint64_t ns_id, uint64_t id,
|
||||
Decoration *decor, ExtmarkOp op)
|
||||
{
|
||||
ExtmarkNs *ns = buf_ns_ref(buf, ns_id, true);
|
||||
assert(ns != NULL);
|
||||
mtpos_t old_pos;
|
||||
uint64_t mark = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user