Skip to content

Commit 070ac34

Browse files
chrisbrabrammool
authored andcommitted
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)
1 parent 072f1c6 commit 070ac34

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/eval.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,16 +561,19 @@ eval_to_string_safe(
561561
char_u *retval;
562562
funccal_entry_T funccal_entry;
563563
int save_sc_version = current_sctx.sc_version;
564+
int save_garbage = may_garbage_collect;
564565

565566
current_sctx.sc_version = 1;
566567
save_funccal(&funccal_entry);
567568
if (use_sandbox)
568569
++sandbox;
569570
++textwinlock;
571+
may_garbage_collect = FALSE;
570572
retval = eval_to_string(arg, FALSE);
571573
if (use_sandbox)
572574
--sandbox;
573575
--textwinlock;
576+
may_garbage_collect = save_garbage;
574577
restore_funccal();
575578
current_sctx.sc_version = save_sc_version;
576579
return retval;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3418,
758760
/**/
759761
3417,
760762
/**/

0 commit comments

Comments
 (0)