mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.2692: Vim9: locked script variable can be changed
Problem: Vim9: locked script variable can be changed. Solution: Check for locked value. (closes #8031)
This commit is contained in:
@@ -1958,6 +1958,13 @@ call_def_function(
|
||||
if (sv == NULL)
|
||||
goto failed;
|
||||
--ectx.ec_stack.ga_len;
|
||||
|
||||
// "const" and "final" are checked at compile time, locking
|
||||
// the value needs to be checked here.
|
||||
SOURCING_LNUM = iptr->isn_lnum;
|
||||
if (value_check_lock(sv->sv_tv->v_lock, sv->sv_name, FALSE))
|
||||
goto on_error;
|
||||
|
||||
clear_tv(sv->sv_tv);
|
||||
*sv->sv_tv = *STACK_TV_BOT(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user