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

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

Commit Message

dodji at seketeli dot org Sept. 13, 2021, 10:23 a.m. UTC

--- Comment #3 from dodji at redhat dot com ---

I couldn't reproduce this issue on the branch you mentioned, while compiling
libabigail with gcc.

However, I tried punching in the dark a little bit.

Could you please try this patch and see if it as an impact at all?


diff --git a/src/abg-writer.cc b/src/abg-writer.cc
index 9f48dc92..46b6d456 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());