[applying,to,mainline] dwarf-reader: Fix detection of C language DIEs

Message ID 874jedz85o.fsf@redhat.com
State New
Headers
Series [applying,to,mainline] dwarf-reader: Fix detection of C language DIEs |

Commit Message

Dodji Seketeli Feb. 12, 2024, 9:26 p.m. UTC
  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(-)
  

Patch

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(),