libabigail/0006-Bug-29829-dwarf-reader-Allow-DIEs-to-be-in-a-lexical.patch

37 lines
1.3 KiB
Diff
Raw Normal View History

From 08ed347ebfd108c9c1de0ba65f9a947fda1617ab Mon Sep 17 00:00:00 2001
From: Dodji Seketeli <dodji@redhat.com>
Date: Fri, 2 Dec 2022 15:59:13 +0000
Subject: [PATCH] Bug 29829 - dwarf-reader: Allow DIEs to be in a lexical block
Normally, ABI-relevant DWARF DIEs (types and decls) should be at
namespace level. There are real-life cases where such a DIE might be
defined in a lexical block.
This patch teaches the DWARF reader to handle such cases.
* src/abg-dwarf-reader.cc (get_scope_for_die): Support
DW_TAG_lexical_block as DIE scope.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
src/abg-dwarf-reader.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index 1d6ad24..895a55d 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -10961,7 +10961,8 @@ get_scope_for_die(read_context& ctxt,
scope_decl_sptr s;
type_or_decl_base_sptr d;
if (dwarf_tag(&parent_die) == DW_TAG_subprogram
- || dwarf_tag(&parent_die) == DW_TAG_array_type)
+ || dwarf_tag(&parent_die) == DW_TAG_array_type
+ || dwarf_tag(&parent_die) == DW_TAG_lexical_block)
// this is an entity defined in a scope that is a function.
// Normally, I would say that this should be dropped. But I have
// seen a case where a typedef DIE needed by a function parameter
--
2.27.0