mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(PVS V507): false positive
https://pvs-studio.com/en/docs/warnings/v507/ "Pointer to local array 'sourcing_name_buf' is stored outside the scope of this array. Such a pointer will become invalid." False positive: `sourcing_name = save_sourcing_name` before returning from this scope.
This commit is contained in:
parent
433bda405e
commit
d15defeb2f
@ -1950,7 +1950,7 @@ static int source_using_linegetter(void *cookie, LineGetter fgetline, const char
|
||||
snprintf((char *)sourcing_name_buf, sizeof(sourcing_name_buf),
|
||||
"%s called at %s:%" PRIdLINENR, traceback_name, save_sourcing_name,
|
||||
save_sourcing_lnum);
|
||||
sourcing_name = sourcing_name_buf;
|
||||
sourcing_name = sourcing_name_buf; // -V507 reassigned below, before return.
|
||||
}
|
||||
sourcing_lnum = 0;
|
||||
|
||||
|
@ -170,6 +170,8 @@ void *xrealloc(void *ptr, size_t size)
|
||||
|
||||
/// xmalloc() wrapper that allocates size + 1 bytes and zeroes the last byte
|
||||
///
|
||||
/// Commonly used to allocate strings, e.g. `char *s = xmallocz(len)`.
|
||||
///
|
||||
/// @see {xmalloc}
|
||||
/// @param size
|
||||
/// @return pointer to allocated space. Never NULL
|
||||
|
Loading…
Reference in New Issue
Block a user