Mercurial > vim
comparison src/dict.c @ 17159:3fd0765f454f v8.1.1579
patch 8.1.1579: dict and list could be GC'ed while displaying error
commit https://github.com/vim/vim/commit/adc6714aac20f5462a0ecec50ab4806b2f3ab0db
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 22 01:40:42 2019 +0200
patch 8.1.1579: dict and list could be GC'ed while displaying error
Problem: Dict and list could be GC'ed while displaying error in a timer.
(Yasuhiro Matsumoto)
Solution: Block garbage collection when executing a timer. Add
test_garbagecollect_soon(). Add "no_wait_return" to
test_override(). (closes #4571)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 22 Jun 2019 01:45:05 +0200 |
parents | efc6f5e3b543 |
children | 6604ecb7a615 |
comparison
equal
deleted
inserted
replaced
17158:7aee4ff9e8a5 | 17159:3fd0765f454f |
---|---|
26 dict_T * | 26 dict_T * |
27 dict_alloc(void) | 27 dict_alloc(void) |
28 { | 28 { |
29 dict_T *d; | 29 dict_T *d; |
30 | 30 |
31 d = ALLOC_ONE(dict_T); | 31 d = ALLOC_CLEAR_ONE(dict_T); |
32 if (d != NULL) | 32 if (d != NULL) |
33 { | 33 { |
34 /* Add the dict to the list of dicts for garbage collection. */ | 34 /* Add the dict to the list of dicts for garbage collection. */ |
35 if (first_dict != NULL) | 35 if (first_dict != NULL) |
36 first_dict->dv_used_prev = d; | 36 first_dict->dv_used_prev = d; |
809 | 809 |
810 if (**arg != '}') | 810 if (**arg != '}') |
811 { | 811 { |
812 semsg(_("E723: Missing end of Dictionary '}': %s"), *arg); | 812 semsg(_("E723: Missing end of Dictionary '}': %s"), *arg); |
813 failret: | 813 failret: |
814 if (evaluate) | 814 if (d != NULL) |
815 dict_free(d); | 815 dict_free(d); |
816 return FAIL; | 816 return FAIL; |
817 } | 817 } |
818 | 818 |
819 *arg = skipwhite(*arg + 1); | 819 *arg = skipwhite(*arg + 1); |