diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-11-13 23:27:49 +0100 |
---|---|---|
committer | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-11-15 12:49:18 +0100 |
commit | ce9c4e9a6f253b1540a5367f834f6dd31e6db0c8 (patch) | |
tree | c778281bb3d9e49bf18b4e02708b9d95e1bb8f56 /src | |
parent | 2aa8c7c41fd49c5763b4552c92b174851c595267 (diff) | |
download | rneovim-ce9c4e9a6f253b1540a5367f834f6dd31e6db0c8.tar.gz rneovim-ce9c4e9a6f253b1540a5367f834f6dd31e6db0c8.tar.bz2 rneovim-ce9c4e9a6f253b1540a5367f834f6dd31e6db0c8.zip |
Fix warnings: syntax.c: syn_regexec(): Uninitialized arg: MI.
Problem : Uninitialized argument value @ 2863.
Diagnostic : Multithreading issue.
Rationale : Error can only occur if global `syn_time_on` is changed
while the function is executing.
Resolution : Use local copy of gloval var.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/syntax.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index e0c9628985..4a3ab46e75 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -2851,15 +2851,16 @@ static int syn_regexec(regmmatch_T *rmp, linenr_T lnum, colnr_T col, syn_time_T { int r; proftime_T pt; + const int l_syn_time_on = syn_time_on; - if (syn_time_on) { + if (l_syn_time_on) { pt = profile_start(); } rmp->rmm_maxcol = syn_buf->b_p_smc; r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL); - if (syn_time_on) { + if (l_syn_time_on) { pt = profile_end(pt); st->total = profile_add(st->total, pt); if (profile_cmp(pt, st->slowest) < 0) { |