fix utest asan

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
zhoufeng 2020-08-27 18:42:36 +08:00
parent dc0626497e
commit f62067ef83
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ endif()
if (ENABLE_ASAN)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fsanitize=undefined")
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fsanitize=address -fsanitize-recover=address -fno-omit-frame-pointer -fsanitize=undefined")
else()
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libsan -fsanitize=undefined")
endif()

View File

@ -60,7 +60,7 @@ std::string CodeAsString(const StatusCode c) {
return std::string(s);
}
Status::Status(StatusCode c) noexcept : code_(c), err_msg_(std::move(CodeAsString(c))) {}
Status::Status(StatusCode c) noexcept : code_(c), err_msg_(CodeAsString(c)) {}
Status::Status() noexcept : code_(StatusCode::kOK), err_msg_("") {}