diff src/vim9compile.c @ 21220:ad13736a1783 v8.2.1161

patch 8.2.1161: Vim9: using freed memory Commit: https://github.com/vim/vim/commit/8e2730a315b8b06192f5fc822dc218dbb3cff7ae Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 8 22:01:49 2020 +0200 patch 8.2.1161: Vim9: using freed memory Problem: Vim9: using freed memory. Solution: Put pointer back in evalarg instead of freeing it.
author Bram Moolenaar <Bram@vim.org>
date Wed, 08 Jul 2020 22:15:04 +0200
parents 1f4d0375f947
children 3f14e0d4a4dd
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3113,6 +3113,8 @@ compile_lambda(char_u **arg, cctx_T *cct
     // Compile it into instructions.
     compile_def_function(ufunc, TRUE, cctx);
 
+    clear_evalarg(&evalarg, NULL);
+
     if (ufunc->uf_def_status == UF_COMPILED)
 	return generate_FUNCREF(cctx, ufunc->uf_dfunc_idx);
     return FAIL;