mirror of
https://github.com/tmux/tmux.git
synced 2026-10-10 20:24:21 +00:00
Build with ASAN on macOS by default.
This commit is contained in:
@@ -43,7 +43,8 @@ AM_CPPFLAGS += -DDEBUG
|
|||||||
endif
|
endif
|
||||||
AM_CPPFLAGS += -iquote.
|
AM_CPPFLAGS += -iquote.
|
||||||
if IS_ASAN
|
if IS_ASAN
|
||||||
AM_CFLAGS += -fsanitize=address
|
AM_CPPFLAGS += -DASAN
|
||||||
|
AM_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
||||||
AM_LDFLAGS += -fsanitize=address
|
AM_LDFLAGS += -fsanitize=address
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ AC_ARG_ENABLE(
|
|||||||
asan,
|
asan,
|
||||||
AS_HELP_STRING(--enable-asan, enable ASAN build flags),
|
AS_HELP_STRING(--enable-asan, enable ASAN build flags),
|
||||||
,
|
,
|
||||||
enable_asan=no
|
[case "x$host_os" in *darwin*) enable_asan=yes;; esac]
|
||||||
)
|
)
|
||||||
AM_CONDITIONAL(IS_ASAN, test "x$enable_asan" = xyes)
|
AM_CONDITIONAL(IS_ASAN, test "x$enable_asan" = xyes)
|
||||||
|
|
||||||
|
|||||||
3
grid.c
3
grid.c
@@ -366,6 +366,9 @@ grid_create(u_int sx, u_int sy, u_int hlimit)
|
|||||||
if (gd->sy != 0)
|
if (gd->sy != 0)
|
||||||
gd->linedata = xcalloc(gd->sy, sizeof *gd->linedata);
|
gd->linedata = xcalloc(gd->sy, sizeof *gd->linedata);
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
assert(gd->hsize == 0);
|
||||||
|
#endif
|
||||||
grid_check_is_clear(gd);
|
grid_check_is_clear(gd);
|
||||||
return (gd);
|
return (gd);
|
||||||
}
|
}
|
||||||
|
|||||||
18
tmux.c
18
tmux.c
@@ -49,6 +49,24 @@ static char *make_label(const char *, char **);
|
|||||||
static int areshell(const char *);
|
static int areshell(const char *);
|
||||||
static const char *getshell(void);
|
static const char *getshell(void);
|
||||||
|
|
||||||
|
#ifdef ASAN
|
||||||
|
__attribute__((used)) const char *__asan_default_options(void);
|
||||||
|
__attribute__((used)) const char *
|
||||||
|
__asan_default_options(void)
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
"abort_on_error=1:"
|
||||||
|
"halt_on_error=1:"
|
||||||
|
"detect_leaks=0:"
|
||||||
|
"detect_stack_use_after_return=1:"
|
||||||
|
"strict_string_checks=1:"
|
||||||
|
"check_initialization_order=1:"
|
||||||
|
"log_path=/tmp/tmux-asan:"
|
||||||
|
"log_exe_name=1"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static __dead void
|
static __dead void
|
||||||
usage(int status)
|
usage(int status)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user