Skip to content
Snippets Groups Projects
Commit bfb84c3d authored by dutor's avatar dutor Committed by GitHub
Browse files

Add partial support to ASAN (#55)

parent 15b2ca6b
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,9 @@ if(NOT ${NEBULA_GPERF_BIN_DIR} STREQUAL "")
endif()
option(sanitize "Whether to turn AddressSanitizer ON or OFF" OFF)
message(STATUS "CMAKE_INCLUDE_PATH: " ${CMAKE_INCLUDE_PATH})
message(STATUS "CMAKE_LIBRARY_PATH: " ${CMAKE_LIBRARY_PATH})
message(STATUS "CMAKE_PROGRAM_PATH: " ${CMAKE_PROGRAM_PATH})
......@@ -99,19 +102,29 @@ message(STATUS "CMAKE_PROGRAM_PATH: " ${CMAKE_PROGRAM_PATH})
find_package(Boost REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Krb5 REQUIRED gssapi)
find_package(PCHSupport)
find_package(GPERF 2.8 REQUIRED)
find_package(Libunwind REQUIRED)
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
find_package(Readline REQUIRED)
if(NOT sanitize)
find_package(PCHSupport)
add_compile_options(-Winvalid-pch)
endif()
add_compile_options(-Winvalid-pch)
add_compile_options(-Wall)
add_compile_options(-Werror)
add_compile_options(-Wunused-parameter)
add_compile_options(-Wshadow)
if(sanitize)
add_compile_options(-fsanitize=address)
add_compile_options(-g)
add_compile_options(-fno-omit-frame-pointer)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif()
include_directories(SYSTEM ${NEBULA_HOME}/third-party/bzip2/_install/include)
include_directories(SYSTEM ${NEBULA_HOME}/third-party/double-conversion/_install/include)
include_directories(SYSTEM ${NEBULA_HOME}/third-party/fatal/_install/include)
......
......@@ -19,7 +19,8 @@ namespace nebula {
using semantic_type = nebula::GraphParser::semantic_type;
static auto checkSemanticValue(const char *expected, semantic_type *sv) {
auto &actual = *sv->strval;
auto actual = *sv->strval;
delete sv->strval;
if (expected != actual) {
return AssertionFailure() << "Semantic value not match, "
<< "expected: " << expected
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment