File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -738,6 +738,8 @@ static char *(features[]) =
738738
739739static int included_patches [] =
740740{ /* Add new patch number below this line */
741+ /**/
742+ 504 ,
741743/**/
742744 503 ,
743745/**/
Original file line number Diff line number Diff line change @@ -3995,6 +3995,18 @@ compile_fill_jump_to_end(endlabel_T **el, cctx_T *cctx)
39953995 }
39963996}
39973997
3998+ static void
3999+ compile_free_jump_to_end (endlabel_T * * el )
4000+ {
4001+ while (* el != NULL )
4002+ {
4003+ endlabel_T * cur = (* el );
4004+
4005+ * el = cur -> el_next ;
4006+ vim_free (cur );
4007+ }
4008+ }
4009+
39984010/*
39994011 * Create a new scope and set up the generic items.
40004012 */
@@ -4026,6 +4038,20 @@ drop_scope(cctx_T *cctx)
40264038 return ;
40274039 }
40284040 cctx -> ctx_scope = scope -> se_outer ;
4041+ switch (scope -> se_type )
4042+ {
4043+ case IF_SCOPE :
4044+ compile_free_jump_to_end (& scope -> se_u .se_if .is_end_label ); break ;
4045+ case FOR_SCOPE :
4046+ compile_free_jump_to_end (& scope -> se_u .se_for .fs_end_label ); break ;
4047+ case WHILE_SCOPE :
4048+ compile_free_jump_to_end (& scope -> se_u .se_while .ws_end_label ); break ;
4049+ case TRY_SCOPE :
4050+ compile_free_jump_to_end (& scope -> se_u .se_try .ts_end_label ); break ;
4051+ case NO_SCOPE :
4052+ case BLOCK_SCOPE :
4053+ break ;
4054+ }
40294055 vim_free (scope );
40304056}
40314057
@@ -5519,6 +5545,9 @@ compile_def_function(ufunc_T *ufunc, int set_return_type)
55195545 if (!dfunc -> df_deleted )
55205546 -- def_functions .ga_len ;
55215547
5548+ while (cctx .ctx_scope != NULL )
5549+ drop_scope (& cctx );
5550+
55225551 // Don't execute this function body.
55235552 ga_clear_strings (& ufunc -> uf_lines );
55245553
You can’t perform that action at this time.
0 commit comments