robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

bfredlMerge pull request #23259 from ii14/build/ubsan_default_options88a202a010

master
703 B25 linesraw
1#!/bin/bash
2
3# Helper script to build and run neovim with Address Sanitizer enabled.
4# You may read more information in src/nvim/README.md in the section "Build
5# with ASAN".
6
7shopt -s nullglob
8
9root_path=$(git rev-parse --show-toplevel)
10log_path=$(mktemp -d)
11export CC='clang'
12
13# Change to detect_leaks=1 to detect memory leaks (slower).
14export ASAN_OPTIONS="detect_leaks=0:log_path=$log_path/asan"
15
16make -C "$root_path" CMAKE_EXTRA_FLAGS="-DENABLE_ASAN_UBSAN=ON"
17VIMRUNTIME="$root_path"/runtime "$root_path"/build/bin/nvim
18
19# Need to manually reset terminal to avoid mangled output, nvim does not
20# properly restore the terminal when it crashes.
21tput reset
22
23for i in "$log_path"/*; do
24  cat "$i"
25done