# HG changeset patch # User Bram Moolenaar # Date 1631182506 -7200 # Node ID d62bf68986df04c8ee7e4a7c4a1cf46c4c9d9ec6 # Parent ca88b83dc89a0e9b0dbf5143d114a8a16314ba03 patch 8.2.3418: garbage collection while evaluating may cause trouble Commit: https://github.com/vim/vim/commit/070ac3433b0ebefd6dc6cd49707fcfa1421b9e67 Author: Christian Brabandt Date: Thu Sep 9 12:12:03 2021 +0200 patch 8.2.3418: garbage collection while evaluating may cause trouble Problem: Garbage collection while evaluating may cause trouble. Solution: Disable garbage collection while evaluating an expression. (Christian Brabandt, issue #8848) diff --git a/src/eval.c b/src/eval.c --- 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; diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3418, +/**/ 3417, /**/ 3416,