Mercurial > vim
comparison src/ex_cmds2.c @ 9153:c2fe86f2bda1 v7.4.1860
commit https://github.com/vim/vim/commit/e3188e261569ae512fb1ae2653b57fdd9e259ca3
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 31 21:13:04 2016 +0200
patch 7.4.1860
Problem: Using a partial for timer_start() may cause a crash.
Solution: Set the copyID in timer objects. (Ozaki Kiichi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 31 May 2016 21:15:06 +0200 |
parents | 932f94b2d8c2 |
children | e4d7e6d1a0f1 |
comparison
equal
deleted
inserted
replaced
9152:b780d4eac8c7 | 9153:c2fe86f2bda1 |
---|---|
1250 stop_timer(timer_T *timer) | 1250 stop_timer(timer_T *timer) |
1251 { | 1251 { |
1252 remove_timer(timer); | 1252 remove_timer(timer); |
1253 free_timer(timer); | 1253 free_timer(timer); |
1254 } | 1254 } |
1255 | |
1256 /* | |
1257 * Mark references in partials of timers. | |
1258 */ | |
1259 int | |
1260 set_ref_in_timer(int copyID) | |
1261 { | |
1262 int abort = FALSE; | |
1263 timer_T *timer; | |
1264 typval_T tv; | |
1265 | |
1266 for (timer = first_timer; timer != NULL; timer = timer->tr_next) | |
1267 { | |
1268 tv.v_type = VAR_PARTIAL; | |
1269 tv.vval.v_partial = timer->tr_partial; | |
1270 abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); | |
1271 } | |
1272 return abort; | |
1273 } | |
1255 # endif | 1274 # endif |
1256 | 1275 |
1257 #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT) | 1276 #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT) |
1258 # if defined(HAVE_MATH_H) | 1277 # if defined(HAVE_MATH_H) |
1259 # include <math.h> | 1278 # include <math.h> |