Patch 8.2.2786
Problem:    Vim9: memory leak when using :s with expression.
Solution:   Clean up the instruction list.
Files:      src/vim9compile.c


*** ../vim-8.2.2785/src/vim9compile.c   2021-04-19 20:49:58.156857538 +0200
--- src/vim9compile.c   2021-04-19 21:04:37.130647550 +0200
***************
*** 9416,9423 ****
            break;
  
        case ISN_SUBSTITUTE:
!           vim_free(isn->isn_arg.subs.subs_cmd);
!           vim_free(isn->isn_arg.subs.subs_instr);
            break;
  
        case ISN_LOADS:
--- 9416,9430 ----
            break;
  
        case ISN_SUBSTITUTE:
!           {
!               int     idx;
!               isn_T   *list = isn->isn_arg.subs.subs_instr;
! 
!               vim_free(isn->isn_arg.subs.subs_cmd);
!               for (idx = 0; list[idx].isn_type != ISN_FINISH; ++idx)
!                   delete_instr(list + idx);
!               vim_free(list);
!           }
            break;
  
        case ISN_LOADS:
*** ../vim-8.2.2785/src/version.c       2021-04-19 20:49:58.160857530 +0200
--- src/version.c       2021-04-19 21:05:35.638491907 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2786,
  /**/

-- 
The difference between theory and practice, is that in theory, there
is no difference between theory and practice.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202104191906.13JJ6vn1657136%40masaka.moolenaar.net.

Raspunde prin e-mail lui