comparison src/evalfunc.c @ 10952:835604f3c37a v8.0.0365

patch 8.0.0365: might free a dict item that wasn't allocated commit https://github.com/vim/vim/commit/95c526e1f6d76acafee4b21f5701d6d6ac8c4b5f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 25 14:59:34 2017 +0100 patch 8.0.0365: might free a dict item that wasn't allocated Problem: Might free a dict item that wasn't allocated. Solution: Call dictitem_free(). (Nikolai Pavlov) Use this for b:changedtick.
author Christian Brabandt <cb@256bit.org>
date Sat, 25 Feb 2017 15:00:05 +0100
parents fd1760f8c215
children b3601a8eb679
comparison
equal deleted inserted replaced
10951:32704a1de17c 10952:835604f3c37a
2548 int col; 2548 int col;
2549 2549
2550 if (lnum < 0) /* ignore type error in {lnum} arg */ 2550 if (lnum < 0) /* ignore type error in {lnum} arg */
2551 lnum = 0; 2551 lnum = 0;
2552 if (lnum != prev_lnum 2552 if (lnum != prev_lnum
2553 || changedtick != *curbuf->b_changedtick 2553 || changedtick != CHANGEDTICK(curbuf)
2554 || fnum != curbuf->b_fnum) 2554 || fnum != curbuf->b_fnum)
2555 { 2555 {
2556 /* New line, buffer, change: need to get the values. */ 2556 /* New line, buffer, change: need to get the values. */
2557 filler_lines = diff_check(curwin, lnum); 2557 filler_lines = diff_check(curwin, lnum);
2558 if (filler_lines < 0) 2558 if (filler_lines < 0)
2570 hlID = HLF_ADD; /* added line */ 2570 hlID = HLF_ADD; /* added line */
2571 } 2571 }
2572 else 2572 else
2573 hlID = (hlf_T)0; 2573 hlID = (hlf_T)0;
2574 prev_lnum = lnum; 2574 prev_lnum = lnum;
2575 changedtick = *curbuf->b_changedtick; 2575 changedtick = CHANGEDTICK(curbuf);
2576 fnum = curbuf->b_fnum; 2576 fnum = curbuf->b_fnum;
2577 } 2577 }
2578 2578
2579 if (hlID == HLF_CHD || hlID == HLF_TXD) 2579 if (hlID == HLF_CHD || hlID == HLF_TXD)
2580 { 2580 {
3955 dict_add_nr_str(dict, "lnum", buf == curbuf ? curwin->w_cursor.lnum 3955 dict_add_nr_str(dict, "lnum", buf == curbuf ? curwin->w_cursor.lnum
3956 : buflist_findlnum(buf), NULL); 3956 : buflist_findlnum(buf), NULL);
3957 dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL); 3957 dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL);
3958 dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL); 3958 dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL);
3959 dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL); 3959 dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL);
3960 dict_add_nr_str(dict, "changedtick", *buf->b_changedtick, NULL); 3960 dict_add_nr_str(dict, "changedtick", CHANGEDTICK(buf), NULL);
3961 dict_add_nr_str(dict, "hidden", 3961 dict_add_nr_str(dict, "hidden",
3962 buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0, 3962 buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0,
3963 NULL); 3963 NULL);
3964 3964
3965 /* Get a reference to buffer variables */ 3965 /* Get a reference to buffer variables */