diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-14 22:23:02 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-14 22:23:02 +0100 |
commit | 249e1b903a9c0460d618f6dcc59aeb8c03b24b20 (patch) | |
tree | 77110ae4e3e3fe155aa92e670f0f4a8315761bc4 /src/testdir | |
parent | dbdd16b62560413abcc3c8e893cc3010ccf31666 (diff) |
patch 9.0.0213: using freed memory with error in assert argumentv9.0.0213
Problem: Using freed memory with error in assert argument.
Solution: Make a copy of the error.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_assert.vim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim index 27b2d73fbf..7c9d090b39 100644 --- a/src/testdir/test_assert.vim +++ b/src/testdir/test_assert.vim @@ -291,6 +291,10 @@ func Test_assert_fail_fails() let exp = v:exception endtry call assert_match("E1174: String required for argument 5", exp) + + call assert_equal(1, assert_fails('c0', ['', '\1'])) + call assert_match("Expected '\\\\\\\\1' but got 'E939: Positive count required: c0': c0", v:errors[0]) + call remove(v:errors, 0) endfunc func Test_assert_fails_in_try_block() |