Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
21219:8ad4d2754054 | 21220:ad13736a1783 |
---|---|
3110 ga_init2(&ufunc->uf_type_list, sizeof(type_T *), 10); | 3110 ga_init2(&ufunc->uf_type_list, sizeof(type_T *), 10); |
3111 | 3111 |
3112 // The function will have one line: "return {expr}". | 3112 // The function will have one line: "return {expr}". |
3113 // Compile it into instructions. | 3113 // Compile it into instructions. |
3114 compile_def_function(ufunc, TRUE, cctx); | 3114 compile_def_function(ufunc, TRUE, cctx); |
3115 | |
3116 clear_evalarg(&evalarg, NULL); | |
3115 | 3117 |
3116 if (ufunc->uf_def_status == UF_COMPILED) | 3118 if (ufunc->uf_def_status == UF_COMPILED) |
3117 return generate_FUNCREF(cctx, ufunc->uf_dfunc_idx); | 3119 return generate_FUNCREF(cctx, ufunc->uf_dfunc_idx); |
3118 return FAIL; | 3120 return FAIL; |
3119 } | 3121 } |