Problem: Vim9: using an option value may use uninitialized memory.
Solution: Clear v_lock. (closes #7620)
CheckScriptSuccess(lines)
enddef
+def SetSomeVar()
+ b:someVar = &fdm
+enddef
+
def Test_expr7_option()
# option
set ts=11
var bval: bool = &tgc
var nval: number = &ts
var sval: string = &path
+
+ # check v_lock is cleared (requires using valgrind, doesn't always show)
+ SetSomeVar()
+ b:someVar = 0
+ unlet b:someVar
enddef
def Test_expr7_environment()
}
else if (rettv != NULL)
{
+ rettv->v_lock = 0;
if (opt_type == gov_hidden_string)
{
rettv->v_type = VAR_STRING;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2302,
/**/
2301,
/**/