To: vim_dev@googlegroups.com Subject: Patch 8.2.3746 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3746 Problem: Cannot disassemble function starting with "debug" or "profile". Solution: Check for white space following. (closes #9273) Files: src/vim9execute.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.3745/src/vim9execute.c 2021-12-04 13:15:07.336273914 +0000 --- src/vim9execute.c 2021-12-05 17:17:59.191051567 +0000 *************** *** 5904,5915 **** int is_global = FALSE; compiletype_T compile_type = CT_NONE; ! if (STRNCMP(arg, "profile", 7) == 0) { compile_type = CT_PROFILE; arg = skipwhite(arg + 7); } ! else if (STRNCMP(arg, "debug", 5) == 0) { compile_type = CT_DEBUG; arg = skipwhite(arg + 5); --- 5904,5915 ---- int is_global = FALSE; compiletype_T compile_type = CT_NONE; ! 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 && VIM_ISWHITE(arg[5])) { compile_type = CT_DEBUG; arg = skipwhite(arg + 5); *** ../vim-8.2.3745/src/testdir/test_vim9_script.vim 2021-12-01 17:37:56.440650135 +0000 --- src/testdir/test_vim9_script.vim 2021-12-05 17:15:57.579243063 +0000 *************** *** 3988,3993 **** --- 3988,4028 ---- &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 *** ../vim-8.2.3745/src/version.c 2021-12-05 13:39:57.624815980 +0000 --- src/version.c 2021-12-05 17:17:11.915127184 +0000 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 3746, /**/ -- An alien life briefly visits earth. Just before departing it leaves a message in the dust on the back of a white van. The world is shocked and wants to know what it means. After months of studies the worlds best linguistic scientists are able to decipher the message: "Wash me!". /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///