From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] writer: Avoid sigsev on types with no translation unit
Date: Wed, 08 Sep 2021 16:28:09 +0200 [thread overview]
Message-ID: <8735qff8g6.fsf@redhat.com> (raw)
Hello,
referenced_type_should_be_emitted should not crash on types with
associated translation unit, like e.g, "void type".
Fixed thus.
* src/abg-writer.cc (referenced_type_should_be_emitted): Don't
crash on types with no associated translation unit.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
src/abg-writer.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/abg-writer.cc b/src/abg-writer.cc
index f18293dc..4940e755 100644
--- a/src/abg-writer.cc
+++ b/src/abg-writer.cc
@@ -2263,8 +2263,9 @@ referenced_type_should_be_emitted(const type_base *t,
const translation_unit& tu,
bool tu_is_last)
{
- if ((tu_is_last || t->get_translation_unit()->get_absolute_path()
- == tu.get_absolute_path())
+ if ((tu_is_last || (t->get_translation_unit()
+ && (t->get_translation_unit()->get_absolute_path()
+ == tu.get_absolute_path())))
&& !ctxt.type_is_emitted(t)
&& !ctxt.decl_only_type_is_emitted(t))
return true;
--
2.30.0
--
Dodji
reply other threads:[~2021-09-08 14:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=8735qff8g6.fsf@redhat.com \
--to=dodji@redhat.com \
--cc=libabigail@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).