public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, applying to mainline] dwarf-reader: Fix detection of C language DIEs
@ 2024-02-12 21:26 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2024-02-12 21:26 UTC (permalink / raw)
  To: libabigail

Hello,

If a DIE comes from C, then for that type, namespace support is
disabled.  In this case, we mistakenly look at the language of the
current translation unit DIE rather than the language of the DIE
itself.  So we mistakenly find that the DIE comes from C when it
actually can come from C++.  And we thus mistakenly disable
namespaces.

Fixed thus.

	* src/abg-dwarf-reader.cc (build_ir_node_from_die): Use
	reader::die_is_in_c rather than looking at the language of the
	current translation unit.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applying to the master branch.
---
 src/abg-dwarf-reader.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index 8c624d48..dc491b93 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -16181,7 +16181,7 @@ build_ir_node_from_die(reader&	rdr,
   if (!die)
     return decl_base_sptr();
 
-  if (is_c_language(rdr.cur_transl_unit()->get_language()))
+  if (rdr.die_is_in_c(die))
     {
       const scope_decl_sptr& scop = rdr.global_scope();
       return build_ir_node_from_die(rdr, die, scop.get(),
-- 
2.39.3


-- 
		Dodji


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

only message in thread, other threads:[~2024-02-12 21:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-12 21:26 [PATCH, applying to mainline] dwarf-reader: Fix detection of C language DIEs Dodji Seketeli

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