Skip to content

Commit 5cfc47c

Browse files
authored
Add enough LSAN suppressions for project to compile with TON_USE_ASAN=1 (#1897)
Note that most tests don't work under UBSAN+ASAN for various reasons.
1 parent d013902 commit 5cfc47c

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

crypto/block/create-state.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080

8181
using td::Ref;
8282

83+
extern "C" const char* __asan_default_options() {
84+
return "detect_leaks=0";
85+
}
86+
8387
int verbosity;
8488

8589
enum { wc_master = -1, wc_base = 0 };

crypto/fift/fift-main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
#include "git.h"
5353
#include "words.h"
5454

55+
extern "C" const char* __asan_default_options() {
56+
return "detect_leaks=0";
57+
}
58+
5559
void usage(const char* progname) {
5660
std::cerr << "A simple Fift interpreter. Type `bye` to quit, or `words` to get a list of all commands\n";
5761
std::cerr

crypto/func/func-main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#include "func.h"
3636
#include "git.h"
3737

38+
extern "C" const char* __asan_default_options() {
39+
return "detect_leaks=0";
40+
}
41+
3842
void usage(const char* progname) {
3943
std::cerr
4044
<< "usage: " << progname

tl/generate/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ if (NOT CMAKE_CROSSCOMPILING)
6363
foreach(tl_scheme lite_api ton_api tonlib_api)
6464
add_custom_command(
6565
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/scheme
66-
COMMAND $<TARGET_FILE:tl-parser> -e "${tl_scheme}.tlo" "${tl_scheme}.tl"
66+
COMMAND
67+
${CMAKE_COMMAND} -E env ASAN_OPTIONS=detect_leaks=0
68+
$<TARGET_FILE:tl-parser> -e "${tl_scheme}.tlo" "${tl_scheme}.tl"
6769
DEPENDS tl-parser "scheme/${tl_scheme}.tl"
6870
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/scheme/${tl_scheme}.tlo"
6971
)

0 commit comments

Comments
 (0)