Mercurial > vim
comparison src/testdir/test_vim9_expr.vim @ 23519:cb66613dd9d5 v8.2.2302
patch 8.2.2302: Vim9: using an option value may use uninitialized memory
Commit: https://github.com/vim/vim/commit/a79925a0a8f00577782090859eb0ef69e220d4aa
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 5 17:50:28 2021 +0100
patch 8.2.2302: Vim9: using an option value may use uninitialized memory
Problem: Vim9: using an option value may use uninitialized memory.
Solution: Clear v_lock. (closes https://github.com/vim/vim/issues/7620)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 05 Jan 2021 18:00:04 +0100 |
parents | 8cce160b9183 |
children | 54ec7c8b7459 |
comparison
equal
deleted
inserted
replaced
23518:e7e55755e933 | 23519:cb66613dd9d5 |
---|---|
2424 ]) | 2424 ]) |
2425 END | 2425 END |
2426 CheckScriptSuccess(lines) | 2426 CheckScriptSuccess(lines) |
2427 enddef | 2427 enddef |
2428 | 2428 |
2429 def SetSomeVar() | |
2430 b:someVar = &fdm | |
2431 enddef | |
2432 | |
2429 def Test_expr7_option() | 2433 def Test_expr7_option() |
2430 # option | 2434 # option |
2431 set ts=11 | 2435 set ts=11 |
2432 assert_equal(11, &ts) | 2436 assert_equal(11, &ts) |
2433 &ts = 9 | 2437 &ts = 9 |
2441 | 2445 |
2442 # check matching type | 2446 # check matching type |
2443 var bval: bool = &tgc | 2447 var bval: bool = &tgc |
2444 var nval: number = &ts | 2448 var nval: number = &ts |
2445 var sval: string = &path | 2449 var sval: string = &path |
2450 | |
2451 # check v_lock is cleared (requires using valgrind, doesn't always show) | |
2452 SetSomeVar() | |
2453 b:someVar = 0 | |
2454 unlet b:someVar | |
2446 enddef | 2455 enddef |
2447 | 2456 |
2448 def Test_expr7_environment() | 2457 def Test_expr7_environment() |
2449 # environment variable | 2458 # environment variable |
2450 assert_equal('testvar', $TESTVAR) | 2459 assert_equal('testvar', $TESTVAR) |