comparison src/vim9compile.c @ 20189:63cc54100ae4 v8.2.0650

patch 8.2.0650: Vim9: script function can be deleted Commit: https://github.com/vim/vim/commit/4c17ad94ecb0a0fb26d6fface2614bc5172dea18 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 27 22:47:51 2020 +0200 patch 8.2.0650: Vim9: script function can be deleted Problem: Vim9: script function can be deleted. Solution: Disallow deleting script function. Delete functions when sourcing a script again.
author Bram Moolenaar <Bram@vim.org>
date Mon, 27 Apr 2020 23:00:03 +0200
parents 72b437855299
children 5a397db2c1ed
comparison
equal deleted inserted replaced
20188:085eb4da46f4 20189:63cc54100ae4
2208 } 2208 }
2209 2209
2210 static int 2210 static int
2211 generate_funcref(cctx_T *cctx, char_u *name) 2211 generate_funcref(cctx_T *cctx, char_u *name)
2212 { 2212 {
2213 ufunc_T *ufunc = find_func(name, cctx); 2213 ufunc_T *ufunc = find_func(name, FALSE, cctx);
2214 2214
2215 if (ufunc == NULL) 2215 if (ufunc == NULL)
2216 return FAIL; 2216 return FAIL;
2217 2217
2218 return generate_PUSHFUNC(cctx, vim_strsave(name), ufunc->uf_func_type); 2218 return generate_PUSHFUNC(cctx, vim_strsave(name), ufunc->uf_func_type);
2450 semsg(_(e_unknownfunc), namebuf); 2450 semsg(_(e_unknownfunc), namebuf);
2451 goto theend; 2451 goto theend;
2452 } 2452 }
2453 2453
2454 // If we can find the function by name generate the right call. 2454 // If we can find the function by name generate the right call.
2455 ufunc = find_func(name, cctx); 2455 ufunc = find_func(name, FALSE, cctx);
2456 if (ufunc != NULL) 2456 if (ufunc != NULL)
2457 { 2457 {
2458 res = generate_CALL(cctx, ufunc, argcount); 2458 res = generate_CALL(cctx, ufunc, argcount);
2459 goto theend; 2459 goto theend;
2460 } 2460 }