mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
mark: Avoid address sanitizer error
This commit is contained in:
@@ -1349,10 +1349,11 @@ size_t mark_buffer_amount(const buf_T *const buf)
|
|||||||
/// @return true on success, false on failure.
|
/// @return true on success, false on failure.
|
||||||
bool mark_set_global(const char name, const xfmark_T fm, const bool update)
|
bool mark_set_global(const char name, const xfmark_T fm, const bool update)
|
||||||
{
|
{
|
||||||
xfmark_T *fm_tgt = &(namedfm[mark_global_index(name)]);
|
const int idx = mark_global_index(name);
|
||||||
if (fm_tgt == &namedfm[0] - 1) {
|
if (idx == -1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
xfmark_T *const fm_tgt = &(namedfm[idx]);
|
||||||
if (update && fm.fmark.timestamp <= fm_tgt->fmark.timestamp) {
|
if (update && fm.fmark.timestamp <= fm_tgt->fmark.timestamp) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user