0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.0.0607: after :bwipe + :new bufref might still be valid

Problem:    When creating a bufref, then using :bwipe and :new it might get
            the same memory and bufref_valid() returns true.
Solution:   Add br_fnum to check the buffer number didn't change.
This commit is contained in:
Bram Moolenaar
2017-06-04 14:58:02 +02:00
parent 6e62da3e14
commit 45e5fd135d
6 changed files with 24 additions and 15 deletions

View File

@@ -69,11 +69,13 @@ typedef struct frame_S frame_T;
typedef int scid_T; /* script ID */
typedef struct file_buffer buf_T; /* forward declaration */
/* Reference to a buffer that stores the value of buf_free_count.
/*
* Reference to a buffer that stores the value of buf_free_count.
* bufref_valid() only needs to check "buf" when the count differs.
*/
typedef struct {
buf_T *br_buf;
int br_fnum;
int br_buf_free_count;
} bufref_T;