dwarf-reader: Create new corpus unconditionally

The DWARF reader appears to create a new corpus object only if one is
not already present. However, the only case where there can be
multiple corpora is when build_corpus_group_from_kernel_dist_under is
called and this function clears down the reader context, including the
current corpus, between reading ELF objects.

So it's clearer to just create a fresh corpus object unconditionally
in the DWARF reader.

	* src/abg-dwarf-reader.cc (read_debug_info_into_corpus):
	Create new corpus object unconditionally.

Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Giuliano Procida 2021-05-27 09:53:03 +01:00 committed by Dodji Seketeli
parent 519d7ce8e5
commit 5ccbfd4f29

View File

@ -14251,14 +14251,7 @@ static corpus_sptr
read_debug_info_into_corpus(read_context& ctxt)
{
ctxt.clear_per_corpus_data();
if (!ctxt.current_corpus())
{
corpus_sptr corp (new corpus(ctxt.env(), ctxt.elf_path()));
ctxt.current_corpus(corp);
if (!ctxt.env())
ctxt.env(corp->get_environment());
}
ctxt.current_corpus(std::make_shared<corpus>(ctxt.env(), ctxt.elf_path()));
// First set some mundane properties of the corpus gathered from
// ELF.