From 9d97e4e7ccbc0da87dd6e50ba2f35effea871fc4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 28 Nov 2017 22:39:24 +0100 Subject: [PATCH] Don't use invalid static_cast<> in wxAppConsoleBase ctor Although the object being created _will_ be of type wxAppConsole, it doesn't have this type yet, as wxAppConsole ctor hadn't yet run, and so the static cast is invalid and detected as such by UBSAN in g++ 6.3. --- src/common/appbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index b885f7d992..49cbd36114 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -173,7 +173,7 @@ wxAppConsoleBase::wxAppConsoleBase() m_mainLoop = NULL; m_bDoPendingEventProcessing = true; - ms_appInstance = static_cast(this); + ms_appInstance = reinterpret_cast(this); #ifdef __WXDEBUG__ SetTraceMasks();