[10/11] reader: Fix building of reference type

Message ID 20240814125649.47119-10-dodji@redhat.com
State New
Headers
Series [01/11] Use smart pointers for variables exported from the ABI corpus |

Commit Message

Dodji Seketeli Aug. 14, 2024, 12:56 p.m. UTC
  From: Dodji Seketeli <dodji@redhat.com>

This patch ensures that the built reference type IR node is always associated
with the type-id used in the ABIXML.

	* src/abg-reader.cc (build_reference_type_def): Remove unnecessary
	condition.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-reader.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/src/abg-reader.cc b/src/abg-reader.cc
index 64d16171..8c66d6b4 100644
--- a/src/abg-reader.cc
+++ b/src/abg-reader.cc
@@ -4346,8 +4346,8 @@  build_reference_type_def(reader&		rdr,
 						   is_lvalue, size_in_bits,
 						   alignment_in_bits, loc));
   maybe_set_artificial_location(rdr, node, t);
-  if (rdr.push_and_key_type_decl(t, node, add_to_current_scope))
-    rdr.map_xml_node_to_decl(node, t);
+  ABG_ASSERT(rdr.push_and_key_type_decl(t, node, add_to_current_scope));
+  rdr.map_xml_node_to_decl(node, t);
 
   type_base_sptr pointed_to_type =
     rdr.build_or_get_type_decl(type_id,/*add_to_current_scope=*/ true);