Mercurial > vim
comparison src/userfunc.c @ 15780:5b6c3c7feba8 v8.1.0897
patch 8.1.0897: can modify a:000 when using a reference
commit https://github.com/vim/vim/commit/05c00c038bc16e862e17f9e5c8d5a72af6cf7788
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 11 22:00:11 2019 +0100
patch 8.1.0897: can modify a:000 when using a reference
Problem: Can modify a:000 when using a reference.
Solution: Make check for locked variable stricter. (Ozaki Kiichi,
closes #3930)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 11 Feb 2019 22:15:07 +0100 |
parents | dff66c4670b1 |
children | bd75c9df2a14 |
comparison
equal
deleted
inserted
replaced
15779:503f872f0ec3 | 15780:5b6c3c7feba8 |
---|---|
2392 goto erret; | 2392 goto erret; |
2393 } | 2393 } |
2394 if (fudi.fd_di == NULL) | 2394 if (fudi.fd_di == NULL) |
2395 { | 2395 { |
2396 /* Can't add a function to a locked dictionary */ | 2396 /* Can't add a function to a locked dictionary */ |
2397 if (tv_check_lock(fudi.fd_dict->dv_lock, eap->arg, FALSE)) | 2397 if (var_check_lock(fudi.fd_dict->dv_lock, eap->arg, FALSE)) |
2398 goto erret; | 2398 goto erret; |
2399 } | 2399 } |
2400 /* Can't change an existing function if it is locked */ | 2400 /* Can't change an existing function if it is locked */ |
2401 else if (tv_check_lock(fudi.fd_di->di_tv.v_lock, eap->arg, FALSE)) | 2401 else if (var_check_lock(fudi.fd_di->di_tv.v_lock, eap->arg, FALSE)) |
2402 goto erret; | 2402 goto erret; |
2403 | 2403 |
2404 /* Give the function a sequential number. Can only be used with a | 2404 /* Give the function a sequential number. Can only be used with a |
2405 * Funcref! */ | 2405 * Funcref! */ |
2406 vim_free(name); | 2406 vim_free(name); |