mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
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)
This commit is contained in:
committed by
Bram Moolenaar
parent
072f1c6888
commit
070ac3433b
@@ -561,16 +561,19 @@ eval_to_string_safe(
|
|||||||
char_u *retval;
|
char_u *retval;
|
||||||
funccal_entry_T funccal_entry;
|
funccal_entry_T funccal_entry;
|
||||||
int save_sc_version = current_sctx.sc_version;
|
int save_sc_version = current_sctx.sc_version;
|
||||||
|
int save_garbage = may_garbage_collect;
|
||||||
|
|
||||||
current_sctx.sc_version = 1;
|
current_sctx.sc_version = 1;
|
||||||
save_funccal(&funccal_entry);
|
save_funccal(&funccal_entry);
|
||||||
if (use_sandbox)
|
if (use_sandbox)
|
||||||
++sandbox;
|
++sandbox;
|
||||||
++textwinlock;
|
++textwinlock;
|
||||||
|
may_garbage_collect = FALSE;
|
||||||
retval = eval_to_string(arg, FALSE);
|
retval = eval_to_string(arg, FALSE);
|
||||||
if (use_sandbox)
|
if (use_sandbox)
|
||||||
--sandbox;
|
--sandbox;
|
||||||
--textwinlock;
|
--textwinlock;
|
||||||
|
may_garbage_collect = save_garbage;
|
||||||
restore_funccal();
|
restore_funccal();
|
||||||
current_sctx.sc_version = save_sc_version;
|
current_sctx.sc_version = save_sc_version;
|
||||||
return retval;
|
return retval;
|
||||||
|
@@ -755,6 +755,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3418,
|
||||||
/**/
|
/**/
|
||||||
3417,
|
3417,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user