Convert struct target_ops to C++
[deliverable/binutils-gdb.git] / gdb / exceptions.c
index 49af8a29859d5750df3cedaa6a9b8920594bb5a3..5abbaf21377a8a68a93fe00af68303f808890299 100644 (file)
@@ -39,7 +39,11 @@ print_flush (void)
     deprecated_error_begin_hook ();
 
   gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
-  if (target_supports_terminal_ours ())
+  /* While normally there's always something pushed on the target
+     stack, the NULL check is needed here because we can get here very
+     early during startup, before the target stack is first
+     initialized.  */
+  if (target_stack != NULL && target_supports_terminal_ours ())
     {
       term_state.emplace ();
       target_terminal::ours_for_output ();
This page took 0.025949 seconds and 4 git commands to generate.