comparison src/vim9compile.c @ 24492:cca0a1b4e878 v8.2.2786

patch 8.2.2786: Vim9: memory leak when using :s with expression Commit: https://github.com/vim/vim/commit/4f2df37a0d297a0f40ff15f8ce31285c7b529bcd Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 19 21:06:31 2021 +0200 patch 8.2.2786: Vim9: memory leak when using :s with expression Problem: Vim9: memory leak when using :s with expression. Solution: Clean up the instruction list.
author Bram Moolenaar <Bram@vim.org>
date Mon, 19 Apr 2021 21:15:03 +0200
parents 08050e45bd06
children bfa495227ac6
comparison
equal deleted inserted replaced
24491:a03ddeba7252 24492:cca0a1b4e878
9414 case ISN_STRINGMEMBER: 9414 case ISN_STRINGMEMBER:
9415 vim_free(isn->isn_arg.string); 9415 vim_free(isn->isn_arg.string);
9416 break; 9416 break;
9417 9417
9418 case ISN_SUBSTITUTE: 9418 case ISN_SUBSTITUTE:
9419 vim_free(isn->isn_arg.subs.subs_cmd); 9419 {
9420 vim_free(isn->isn_arg.subs.subs_instr); 9420 int idx;
9421 isn_T *list = isn->isn_arg.subs.subs_instr;
9422
9423 vim_free(isn->isn_arg.subs.subs_cmd);
9424 for (idx = 0; list[idx].isn_type != ISN_FINISH; ++idx)
9425 delete_instr(list + idx);
9426 vim_free(list);
9427 }
9421 break; 9428 break;
9422 9429
9423 case ISN_LOADS: 9430 case ISN_LOADS:
9424 case ISN_STORES: 9431 case ISN_STORES:
9425 vim_free(isn->isn_arg.loadstore.ls_name); 9432 vim_free(isn->isn_arg.loadstore.ls_name);