public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug build/31150] [gdb/build] m_uiout may be used uninitialized in this function [-Wmaybe-uninitialized]
Date: Sun, 24 Dec 2023 09:33:32 +0000	[thread overview]
Message-ID: <bug-31150-4717-XCagKGQrbQ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31150-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31150

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
This seems to fix it:
...
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index 07567a1df35..0ff9b761102 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -406,14 +405,15 @@ class ui_out_emit_type

   ~ui_out_emit_type ()
   {
-    m_uiout->end (Type);
+    if (m_uiout != nullptr)
+      m_uiout->end (Type);
   }

   DISABLE_COPY_AND_ASSIGN (ui_out_emit_type);

 private:

-  struct ui_out *m_uiout;
+  struct ui_out *m_uiout = nullptr;
 };

 typedef ui_out_emit_type<ui_out_type_tuple> ui_out_emit_tuple;
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-12-24  9:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 15:56 [Bug build/31150] New: " vries at gcc dot gnu.org
2023-12-24  9:24 ` [Bug build/31150] " vries at gcc dot gnu.org
2023-12-24  9:33 ` vries at gcc dot gnu.org [this message]
2023-12-24 17:51 ` tromey at sourceware dot org
2023-12-25 11:50 ` vries at gcc dot gnu.org
2023-12-25 17:42 ` tromey at sourceware dot org
2024-01-04 12:03 ` vries at gcc dot gnu.org
2024-01-04 12:04 ` vries at gcc dot gnu.org
2024-01-05 10:23 ` ssbssa at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-31150-4717-XCagKGQrbQ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).