diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-11-15 11:44:37 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-11-15 11:44:37 -0500 |
commit | bc812a82f87644e184b17517936fddf6ff1221e3 (patch) | |
tree | ca6faf2bbc85d9098b6663d2d236ca761175cb2f /src/nvim/undo.c | |
parent | b299c011a04e6c14ec7dc9fd50a58f4a9e5afd40 (diff) | |
parent | 150b0d66e11dc69b1a4fc3daad3016fa74bee4d9 (diff) | |
download | rneovim-bc812a82f87644e184b17517936fddf6ff1221e3.tar.gz rneovim-bc812a82f87644e184b17517936fddf6ff1221e3.tar.bz2 rneovim-bc812a82f87644e184b17517936fddf6ff1221e3.zip |
Merge pull request #1460 from elmart/clang-analysis-fixes-3
Fix clang analysis warnings. (3)
Diffstat (limited to 'src/nvim/undo.c')
-rw-r--r-- | src/nvim/undo.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c index b72d8ddb4f..2ab31b6cfd 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -80,6 +80,7 @@ #define UH_MAGIC 0x18dade /* value for uh_magic when in use */ #define UE_MAGIC 0xabc123 /* value for ue_magic when in use */ +#include <assert.h> #include <inttypes.h> #include <errno.h> #include <stdbool.h> @@ -2682,8 +2683,11 @@ void u_undoline(void) */ void u_blockfree(buf_T *buf) { - while (buf->b_u_oldhead != NULL) + while (buf->b_u_oldhead != NULL) { + u_header_T *previous_oldhead = buf->b_u_oldhead; u_freeheader(buf, buf->b_u_oldhead, NULL); + assert(buf->b_u_oldhead != previous_oldhead); + } free(buf->b_u_line_ptr); } |