mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.3746: cannot disassemble function starting with "debug" or "profile"
Problem: Cannot disassemble function starting with "debug" or "profile". Solution: Check for white space following. (closes #9273)
This commit is contained in:
parent
f661cee847
commit
c7d5fc8622
@ -3988,6 +3988,41 @@ def Test_vim9_autoload()
|
||||
&rtp = save_rtp
|
||||
enddef
|
||||
|
||||
" test disassembling an auto-loaded function starting with "debug"
|
||||
def Test_vim9_autoload_disass()
|
||||
mkdir('Xdir/autoload', 'p')
|
||||
var save_rtp = &rtp
|
||||
exe 'set rtp^=' .. getcwd() .. '/Xdir'
|
||||
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
def debugit#test(): string
|
||||
return 'debug'
|
||||
enddef
|
||||
END
|
||||
writefile(lines, 'Xdir/autoload/debugit.vim')
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
def profileit#test(): string
|
||||
return 'profile'
|
||||
enddef
|
||||
END
|
||||
writefile(lines, 'Xdir/autoload/profileit.vim')
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
assert_equal('debug', debugit#test())
|
||||
disass debugit#test
|
||||
assert_equal('profile', profileit#test())
|
||||
disass profileit#test
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
|
||||
delete('Xdir', 'rf')
|
||||
&rtp = save_rtp
|
||||
enddef
|
||||
|
||||
" test using a vim9script that is auto-loaded from an autocmd
|
||||
def Test_vim9_aucmd_autoload()
|
||||
var lines =<< trim END
|
||||
|
@ -753,6 +753,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
3746,
|
||||
/**/
|
||||
3745,
|
||||
/**/
|
||||
|
@ -5904,12 +5904,12 @@ ex_disassemble(exarg_T *eap)
|
||||
int is_global = FALSE;
|
||||
compiletype_T compile_type = CT_NONE;
|
||||
|
||||
if (STRNCMP(arg, "profile", 7) == 0)
|
||||
if (STRNCMP(arg, "profile", 7) == 0 && VIM_ISWHITE(arg[7]))
|
||||
{
|
||||
compile_type = CT_PROFILE;
|
||||
arg = skipwhite(arg + 7);
|
||||
}
|
||||
else if (STRNCMP(arg, "debug", 5) == 0)
|
||||
else if (STRNCMP(arg, "debug", 5) == 0 && VIM_ISWHITE(arg[5]))
|
||||
{
|
||||
compile_type = CT_DEBUG;
|
||||
arg = skipwhite(arg + 5);
|
||||
|
Loading…
x
Reference in New Issue
Block a user