mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.3824: no ASAN support for MSVC
Problem: No ASAN support for MSVC. Solution: Add ASAN support and fix a coupld of uncovered problems. (Yegappan Lakshmanan, closes #9357)
This commit is contained in:
committed by
Bram Moolenaar
parent
6ecf58b0d7
commit
6df0f2759d
@@ -147,6 +147,8 @@
|
|||||||
#
|
#
|
||||||
# Static Code Analysis: ANALYZE=yes (works with VS2012 or later)
|
# 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
|
# You can combine any of these interfaces
|
||||||
#
|
#
|
||||||
# Example: To build the non-debug, GUI version with Perl interface:
|
# Example: To build the non-debug, GUI version with Perl interface:
|
||||||
@@ -662,6 +664,12 @@ CFLAGS = $(CFLAGS) -DHAVE_STDINT_H
|
|||||||
CFLAGS = $(CFLAGS) /analyze
|
CFLAGS = $(CFLAGS) /analyze
|
||||||
!endif
|
!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
|
!ifdef NODEBUG
|
||||||
VIM = vim
|
VIM = vim
|
||||||
! if "$(OPTIMIZE)" == "SPACE"
|
! if "$(OPTIMIZE)" == "SPACE"
|
||||||
|
@@ -2653,7 +2653,7 @@ simplify_filename(char_u *filename)
|
|||||||
|
|
||||||
p = filename;
|
p = filename;
|
||||||
# ifdef BACKSLASH_IN_FILENAME
|
# ifdef BACKSLASH_IN_FILENAME
|
||||||
if (p[1] == ':') // skip "x:"
|
if (p[0] != NUL && p[1] == ':') // skip "x:"
|
||||||
p += 2;
|
p += 2;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
@@ -389,6 +389,8 @@ mch_isFullName(char_u *fname)
|
|||||||
// Another way to check is to use mch_FullName() and see if the result is
|
// 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
|
// the same as the name or mch_FullName() fails. However, this has quite a
|
||||||
// bit of overhead, so let's not do that.
|
// bit of overhead, so let's not do that.
|
||||||
|
if (*fname == NUL)
|
||||||
|
return TRUE;
|
||||||
return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':'
|
return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':'
|
||||||
&& (fname[2] == '/' || fname[2] == '\\'))
|
&& (fname[2] == '/' || fname[2] == '\\'))
|
||||||
|| (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\')));
|
|| (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\')));
|
||||||
|
@@ -93,6 +93,7 @@ func Test_fnamemodify_er()
|
|||||||
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'))
|
||||||
call assert_equal('b.c', fnamemodify('a.b.c.d.e', ':r:r:e: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()))
|
call assert_equal('', fnamemodify(test_null_string(), test_null_string()))
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -749,6 +749,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3824,
|
||||||
/**/
|
/**/
|
||||||
3823,
|
3823,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user