From 05200e3b1929ce1d6f34b30beffac805b5a41b5e Mon Sep 17 00:00:00 2001 From: Hafiz Abid Qadeer Date: Wed, 26 Nov 2014 10:19:32 +0000 Subject: Re-order the base classes to prevent a crash in Linux. In the initialization list of IOHandlerConfirm, *this is basically casting IOHandlerConfirm to its base IOHandlerDelegate and passing it to constructor of IOHandlerEditline which uses it and crashes as constructor of IOHandlerDelegate is still not called. Re-ordering the base classes makes sure that constructor of IOHandlerDelegate runs first. It would be good to have a test case for this case too. llvm-svn: 222816 --- lldb/include/lldb/Core/IOHandler.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lldb/include/lldb/Core/IOHandler.h b/lldb/include/lldb/Core/IOHandler.h index 8ad38204853..02e6bde1edb 100644 --- a/lldb/include/lldb/Core/IOHandler.h +++ b/lldb/include/lldb/Core/IOHandler.h @@ -628,9 +628,11 @@ namespace lldb_private { bool m_interrupt_exits; }; + // The order of base classes is important. Look at the constructor of IOHandlerConfirm + // to see how. class IOHandlerConfirm : - public IOHandlerEditline, - public IOHandlerDelegate + public IOHandlerDelegate, + public IOHandlerEditline { public: IOHandlerConfirm (Debugger &debugger, -- cgit v1.2.3