[Bug,default/28320] abidw - (non-deterministic) infinite loop in XML writer

Message ID bug-28320-9487-xfp2aCph3o@http.sourceware.org/bugzilla/
State New
Headers
Series [Bug,default/28320] abidw - (non-deterministic) infinite loop in XML writer |

Commit Message

gprocida at google dot com Sept. 13, 2021, 3:12 p.m. UTC
  https://sourceware.org/bugzilla/show_bug.cgi?id=28320

--- Comment #4 from dodji at redhat dot com ---
Hmmh, actually, this one might be the one to try, rather:
  

Patch

diff --git a/src/abg-writer.cc b/src/abg-writer.cc
index 9f48dc92..2062c326 100644
--- a/src/abg-writer.cc
+++ b/src/abg-writer.cc
@@ -2356,7 +2356,8 @@  write_translation_unit(write_context&             ctxt,
          // considered "opaque".
          if (class_decl_sptr class_type = is_class_type(t))
            if (class_type->get_is_declaration_only()
-               && !ctxt.type_is_emitted(class_type))
+               && !ctxt.type_is_emitted(class_type)
+               && !ctxt.decl_only_type_is_emitted(class_type))
              write_type(class_type, ctxt,
                         indent + c.get_xml_element_indent());
          continue;
@@ -2420,7 +2421,8 @@  write_translation_unit(write_context&             ctxt,
          // We handle types which have declarations *and* function
          // types here.
          type_base_sptr t(*i, noop_deleter());
-         if (!ctxt.type_is_emitted(t))
+         if (!ctxt.type_is_emitted(t)
+             && !ctxt.decl_only_type_is_emitted(t))
            {
              if (decl_base* d = get_type_declaration(*i))
                {