[applied] writer: Do not crash on ABI corpora that have no associated path

Message ID 87cykjj0xh.fsf@redhat.com
State New
Headers
Series [applied] writer: Do not crash on ABI corpora that have no associated path |

Commit Message

Dodji Seketeli Oct. 1, 2024, 3:30 p.m. UTC
  Hello,

When write_context::record_corpus_as_emitted is invoked on an ABI
corpus that has no associated path, it crashes as that violates an
assert.

This patch loosens the assert, allowing ABI corpora with no associated
paths to be handled.

	* src/abg-writer.cc (write_context::record_corpus_as_emitted):
	Allow corpus without path.

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

Patch

diff --git a/src/abg-writer.cc b/src/abg-writer.cc
index edd85326..b0bd095e 100644
--- a/src/abg-writer.cc
+++ b/src/abg-writer.cc
@@ -807,9 +807,8 @@  public:
       return;
 
     const string& path = corp->get_path();
-    ABG_ASSERT(!path.empty());
-
-    m_emitted_corpora_set.insert(path);
+    if (!path.empty())
+      m_emitted_corpora_set.insert(path);
   }
 
   /// Get the set of types that have been emitted.