[1/3] abg-dwarf-reader: create new corpus unconditionally
Commit Message
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>
---
src/abg-dwarf-reader.cc | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
@@ -14233,14 +14233,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.