diff options
author | Christian Brabandt <cb@256bit.org> | 2021-09-09 12:12:03 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-09-09 12:12:03 +0200 |
commit | 070ac3433b0ebefd6dc6cd49707fcfa1421b9e67 (patch) | |
tree | 025290f8278a526d4842fbf6ceabbe20a927c41c /src/eval.c | |
parent | 072f1c68884a1e2d468a0f39e27fc28168fb4b03 (diff) |
patch 8.2.3418: garbage collection while evaluating may cause troublev8.2.3418
Problem: Garbage collection while evaluating may cause trouble.
Solution: Disable garbage collection while evaluating an expression.
(Christian Brabandt, issue #8848)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index 6b3d78aa6e..aceba5e2d7 100644 --- a/src/eval.c +++ b/src/eval.c @@ -561,16 +561,19 @@ eval_to_string_safe( char_u *retval; funccal_entry_T funccal_entry; int save_sc_version = current_sctx.sc_version; + int save_garbage = may_garbage_collect; current_sctx.sc_version = 1; save_funccal(&funccal_entry); if (use_sandbox) ++sandbox; ++textwinlock; + may_garbage_collect = FALSE; retval = eval_to_string(arg, FALSE); if (use_sandbox) --sandbox; --textwinlock; + may_garbage_collect = save_garbage; restore_funccal(); current_sctx.sc_version = save_sc_version; return retval; |