[Lldb-commits] [PATCH] D18965: [Driver] Fix a segfault in signal handlers

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 11 09:45:43 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL265958: [Driver] Fix a segfault in signal handlers (authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D18965?vs=53239&id=53265#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18965

Files:
  lldb/trunk/tools/driver/Driver.cpp

Index: lldb/trunk/tools/driver/Driver.cpp
===================================================================
--- lldb/trunk/tools/driver/Driver.cpp
+++ lldb/trunk/tools/driver/Driver.cpp
@@ -1283,16 +1283,20 @@
 void
 sigtstp_handler (int signo)
 {
-    g_driver->GetDebugger().SaveInputTerminalState();
+    if (g_driver)
+        g_driver->GetDebugger().SaveInputTerminalState();
+
     signal (signo, SIG_DFL);
     kill (getpid(), signo);
     signal (signo, sigtstp_handler);
 }
 
 void
 sigcont_handler (int signo)
 {
-    g_driver->GetDebugger().RestoreInputTerminalState();
+    if (g_driver)
+        g_driver->GetDebugger().RestoreInputTerminalState();
+
     signal (signo, SIG_DFL);
     kill (getpid(), signo);
     signal (signo, sigcont_handler);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18965.53265.patch
Type: text/x-patch
Size: 763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160411/76842fa4/attachment.bin>


More information about the lldb-commits mailing list