comparison src/testdir/test_vim9_script.vim @ 28646:a2cf17d0d5da v8.2.4847

patch 8.2.4847: crash when using uninitialized function pointer Commit: https://github.com/vim/vim/commit/a5d3590505fc3e1deea990560d472baa563abed7 Author: LemonBoy <thatlemon@gmail.com> Date: Fri Apr 29 21:15:02 2022 +0100 patch 8.2.4847: crash when using uninitialized function pointer Problem: Crash when using uninitialized function pointer. Solution: Check for NULL pointer. (closes https://github.com/vim/vim/issues/10319, closes https://github.com/vim/vim/issues/10319)
author Bram Moolenaar <Bram@vim.org>
date Fri, 29 Apr 2022 22:30:03 +0200
parents 1d92ba691dc4
children 89ff3a0fff82
comparison
equal deleted inserted replaced
28645:a9eca6be0c8c 28646:a2cf17d0d5da
4113 4113
4114 g:StopVimInTerminal(buf) 4114 g:StopVimInTerminal(buf)
4115 delete('XTest_misplaced_type') 4115 delete('XTest_misplaced_type')
4116 enddef 4116 enddef
4117 4117
4118 " Ensure echo doesn't crash when stringifying empty variables.
4119 def Test_echo_uninit_variables()
4120 var res: string
4121
4122 var var_bool: bool
4123 var var_num: number
4124 var var_float: float
4125 var Var_func: func
4126 var var_string: string
4127 var var_blob: blob
4128 var var_job: job
4129 var var_channel: channel
4130 var var_list: list<any>
4131 var var_dict: dict<any>
4132
4133 redir => res
4134 echo var_bool
4135 echo var_num
4136 echo var_float
4137 echo Var_func
4138 echo var_string
4139 echo var_blob
4140 echo var_job
4141 echo var_channel
4142 echo var_list
4143 echo var_dict
4144 redir END
4145
4146 assert_equal(['false', '0', '0.0', 'function()', '', '0z', 'no process',
4147 'channel fail', '[]', '{}'], res->split('\n'))
4148 enddef
4149
4118 " Keep this last, it messes up highlighting. 4150 " Keep this last, it messes up highlighting.
4119 def Test_substitute_cmd() 4151 def Test_substitute_cmd()
4120 new 4152 new
4121 setline(1, 'something') 4153 setline(1, 'something')
4122 :substitute(some(other( 4154 :substitute(some(other(