diff src/structs.h @ 11447:698ee9d4fe9f v8.0.0607

patch 8.0.0607: after :bwipe + :new bufref might still be valid commit https://github.com/vim/vim/commit/45e5fd135da5710f24a1acc142692f120f8b0b78 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 4 14:58:02 2017 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Sun, 04 Jun 2017 15:00:04 +0200
parents 77f3b7316d8b
children 998d2cf59caa
line wrap: on
line diff
--- a/src/structs.h
+++ b/src/structs.h
@@ -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;