To: vim_dev@googlegroups.com Subject: Patch 8.2.3824 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3824 Problem: No ASAN support for MSVC. Solution: Add ASAN support and fix a coupld of uncovered problems. (Yegappan Lakshmanan, closes #9357) Files: src/Make_mvc.mak, src/findfile.c, src/os_mswin.c, src/testdir/test_fnamemodify.vim *** ../vim-8.2.3823/src/Make_mvc.mak 2021-11-19 11:27:49.107056908 +0000 --- src/Make_mvc.mak 2021-12-16 12:58:18.531536180 +0000 *************** *** 147,152 **** --- 147,154 ---- # # Static Code Analysis: ANALYZE=yes (works with VS2012 or later) # + # Address Sanitizer: ASAN=yes (works with VS2019 or later) + # # You can combine any of these interfaces # # Example: To build the non-debug, GUI version with Perl interface: *************** *** 662,667 **** --- 664,675 ---- CFLAGS = $(CFLAGS) /analyze !endif + # Address Sanitizer (ASAN) generally available starting with VS2019 version + # 16.9 + !if ("$(ASAN)" == "yes") && ($(MSVC_MAJOR) >= 14) + CFLAGS = $(CFLAGS) /fsanitize=address + !endif + !ifdef NODEBUG VIM = vim ! if "$(OPTIMIZE)" == "SPACE" *** ../vim-8.2.3823/src/findfile.c 2021-11-17 19:01:49.606923838 +0000 --- src/findfile.c 2021-12-16 12:58:18.535536165 +0000 *************** *** 2653,2659 **** p = filename; # ifdef BACKSLASH_IN_FILENAME ! if (p[1] == ':') // skip "x:" p += 2; # endif --- 2653,2659 ---- p = filename; # ifdef BACKSLASH_IN_FILENAME ! if (p[0] != NUL && p[1] == ':') // skip "x:" p += 2; # endif *** ../vim-8.2.3823/src/os_mswin.c 2021-11-29 20:39:06.678101624 +0000 --- src/os_mswin.c 2021-12-16 12:58:18.535536165 +0000 *************** *** 389,394 **** --- 389,396 ---- // Another way to check is to use mch_FullName() and see if the result is // the same as the name or mch_FullName() fails. However, this has quite a // bit of overhead, so let's not do that. + if (*fname == NUL) + return TRUE; return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':' && (fname[2] == '/' || fname[2] == '\\')) || (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\'))); *** ../vim-8.2.3823/src/testdir/test_fnamemodify.vim 2021-08-30 20:26:12.860831195 +0100 --- src/testdir/test_fnamemodify.vim 2021-12-16 12:58:18.535536165 +0000 *************** *** 93,98 **** --- 93,99 ---- call assert_equal('b.c', fnamemodify('a.b.c.d.e', ':r:r:e:e:e')) call assert_equal('b.c', fnamemodify('a.b.c.d.e', ':r:r:e:e:e:e')) + call assert_equal('', fnamemodify('', ':p:t')) call assert_equal('', fnamemodify(test_null_string(), test_null_string())) endfunc *** ../vim-8.2.3823/src/version.c 2021-12-16 10:05:18.619384919 +0000 --- src/version.c 2021-12-16 12:59:46.123237378 +0000 *************** *** 751,752 **** --- 751,754 ---- { /* Add new patch number below this line */ + /**/ + 3824, /**/ -- hundred-and-one symptoms of being an internet addict: 39. You move into a new house and setup the Wifi router before unpacking any kitchen stuff. /// 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 ///