public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: Remove deprecated assertion in setting::get
@ 2021-10-05 22:19 Lancelot SIX
  0 siblings, 0 replies; only message in thread
From: Lancelot SIX @ 2021-10-05 22:19 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1461d3712b921466015ab877b6e08ac27456a6a6

commit 1461d3712b921466015ab877b6e08ac27456a6a6
Author: Lancelot SIX <lsix@lancelotsix.com>
Date:   Tue Oct 5 19:55:19 2021 +0000

    gdb: Remove deprecated assertion in setting::get
    
    The commit 702991711a91bd47b209289562843a11e7009396 (gdb: Have setter
    and getter callbacks for settings) makes it possible for a setting not
    to be backed by a memory buffer but use callback functions instead to
    retrieve or set the setting's value.
    
    An assertion was not properly updated to take into account that the
    m_var member (which points to a memory buffer, if used) might be nullptr
    if the setting uses callback functions.  If the setting is backed by a
    memory buffer, the m_var has to be non nullptr, which is already checked
    before the pointer is dereferenced.
    
    This commit removes this assertion as it is not valid anymore.

Diff:
---
 gdb/command.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gdb/command.h b/gdb/command.h
index 7c226f193b8..0049ab6ff9e 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -288,7 +288,6 @@ struct setting
   const T &get () const
   {
     gdb_assert (var_type_uses<T> (m_var_type));
-    gdb_assert (m_var != nullptr);
 
     if (m_var == nullptr)
       {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-05 22:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 22:19 [binutils-gdb] gdb: Remove deprecated assertion in setting::get Lancelot SIX

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).