public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4884] rtl-ssa: Fix null deref in first_any_insn_use
@ 2023-10-24 10:31 Richard Sandiford
  0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2023-10-24 10:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:50313dcdf3324db6d6e522fcaa6ff94dd5de6d3f

commit r14-4884-g50313dcdf3324db6d6e522fcaa6ff94dd5de6d3f
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Tue Oct 24 11:30:52 2023 +0100

    rtl-ssa: Fix null deref in first_any_insn_use
    
    first_any_insn_use implicitly (but contrary to its documentation)
    assumed that there was at least one use.
    
    gcc/
            * rtl-ssa/member-fns.inl (first_any_insn_use): Handle null
            m_first_use.

Diff:
---
 gcc/rtl-ssa/member-fns.inl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rtl-ssa/member-fns.inl b/gcc/rtl-ssa/member-fns.inl
index c127fab8b981..3fdca14e0ef5 100644
--- a/gcc/rtl-ssa/member-fns.inl
+++ b/gcc/rtl-ssa/member-fns.inl
@@ -215,7 +215,7 @@ set_info::last_nondebug_insn_use () const
 inline use_info *
 set_info::first_any_insn_use () const
 {
-  if (m_first_use->is_in_any_insn ())
+  if (m_first_use && m_first_use->is_in_any_insn ())
     return m_first_use;
   return nullptr;
 }

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

only message in thread, other threads:[~2023-10-24 10:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-24 10:31 [gcc r14-4884] rtl-ssa: Fix null deref in first_any_insn_use Richard Sandiford

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