diff options
| author | Bram Moolenaar <Bram@vim.org> | 2016-05-31 21:13:04 +0200 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2016-05-31 21:13:04 +0200 |
| commit | e3188e261569ae512fb1ae2653b57fdd9e259ca3 (patch) | |
| tree | 87c05229ae16e555ac400824415470337734dba4 /src/ex_cmds2.c | |
| parent | ef3abc6442260e9a0314970a532400b05571d3fe (diff) | |
| download | vim-git-e3188e261569ae512fb1ae2653b57fdd9e259ca3.tar.gz | |
patch 7.4.1860v7.4.1860
Problem: Using a partial for timer_start() may cause a crash.
Solution: Set the copyID in timer objects. (Ozaki Kiichi)
Diffstat (limited to 'src/ex_cmds2.c')
| -rw-r--r-- | src/ex_cmds2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index a90fe7d8c..9adaea357 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1252,6 +1252,25 @@ stop_timer(timer_T *timer) remove_timer(timer); free_timer(timer); } + +/* + * Mark references in partials of timers. + */ + int +set_ref_in_timer(int copyID) +{ + int abort = FALSE; + timer_T *timer; + typval_T tv; + + for (timer = first_timer; timer != NULL; timer = timer->tr_next) + { + tv.v_type = VAR_PARTIAL; + tv.vval.v_partial = timer->tr_partial; + abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); + } + return abort; +} # endif #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT) |
