diff --git a/lldb/include/lldb/Utility/LLDBAssert.h b/lldb/include/lldb/Utility/LLDBAssert.h index cc0146be25998..e76dac46b94f4 100644 --- a/lldb/include/lldb/Utility/LLDBAssert.h +++ b/lldb/include/lldb/Utility/LLDBAssert.h @@ -27,8 +27,11 @@ } while (0) #else #define lldbassert(x) \ - lldb_private::_lldb_assert(static_cast(x), #x, __FUNCTION__, __FILE__, \ - __LINE__) + do { \ + static std::once_flag _once_flag; \ + lldb_private::_lldb_assert(static_cast(x), #x, __FUNCTION__, \ + __FILE__, __LINE__, _once_flag); \ + } while (0) #endif #endif