This is an archive of the discontinued LLVM Phabricator instance.

[llvm-pdbutil] Fix a crash due to Expected not checked before destruction
ClosedPublic

Authored by zequanwu on Mar 28 2022, 4:44 PM.

Diff Detail

Event Timeline

zequanwu created this revision.Mar 28 2022, 4:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2022, 4:44 PM
zequanwu requested review of this revision.Mar 28 2022, 4:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2022, 4:44 PM
aganea accepted this revision.Mar 28 2022, 6:26 PM

LGTM with a comment:

llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
492

I think it could help future code readers - if the type of "Sections" was made explicit:

auto SectionsOrErr = getSectionNames(getPdb());
if (!SectionsOrErr)
  return SectionsOrErr.takeError();
ArrayRef<std::string> Sections = *SectionsOrErr;

dumpSectionContrib(P, Desc.getSectionContrib(), Sections, 0);

or just

Expected<std::vector<std::string>> Sections = getSectionNames(getPdb());
1846–1850

Same here.

This revision is now accepted and ready to land.Mar 28 2022, 6:26 PM
This revision was landed with ongoing or failed builds.Mar 29 2022, 10:01 AM
This revision was automatically updated to reflect the committed changes.
zequanwu marked 2 inline comments as done.