Mercurial > vim
comparison src/testdir/test_functions.vim @ 24878:f67773e26cfa v8.2.2977
patch 8.2.2977: crash when using a null function reference
Commit: https://github.com/vim/vim/commit/22db0d549f64aa3d8a6e366b70eb8d7e66933b82
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 12 12:16:55 2021 +0200
patch 8.2.2977: crash when using a null function reference
Problem: Crash when using a null function reference. (Naohiro Ono)
Solution: Check for an invalid function name. (closes https://github.com/vim/vim/issues/8367)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 12 Jun 2021 12:30:04 +0200 |
parents | 3f9053c21765 |
children | 0c415a0f54f9 |
comparison
equal
deleted
inserted
replaced
24877:efbb82e09bcb | 24878:f67773e26cfa |
---|---|
2172 let mydict = {'data': [0, 1, 2, 3], 'len': function("Mylen")} | 2172 let mydict = {'data': [0, 1, 2, 3], 'len': function("Mylen")} |
2173 eval mydict.len->call([], mydict)->assert_equal(4) | 2173 eval mydict.len->call([], mydict)->assert_equal(4) |
2174 call assert_fails("call call('Mylen', [], 0)", 'E715:') | 2174 call assert_fails("call call('Mylen', [], 0)", 'E715:') |
2175 call assert_fails('call foo', 'E107:') | 2175 call assert_fails('call foo', 'E107:') |
2176 | 2176 |
2177 " This once caused a crash. | 2177 " These once caused a crash. |
2178 call call(test_null_function(), []) | 2178 call call(test_null_function(), []) |
2179 call call(test_null_partial(), []) | 2179 call call(test_null_partial(), []) |
2180 call assert_fails('call test_null_function()()', 'E1192:') | |
2181 call assert_fails('call test_null_partial()()', 'E117:') | |
2180 endfunc | 2182 endfunc |
2181 | 2183 |
2182 func Test_char2nr() | 2184 func Test_char2nr() |
2183 call assert_equal(12354, char2nr('あ', 1)) | 2185 call assert_equal(12354, char2nr('あ', 1)) |
2184 call assert_equal(120, 'x'->char2nr()) | 2186 call assert_equal(120, 'x'->char2nr()) |