diff options
author | Jessica Clarke <jrtc27@jrtc27.com> | 2020-04-10 01:30:48 +0100 |
---|---|---|
committer | Jessica Clarke <jrtc27@jrtc27.com> | 2020-04-10 15:05:53 +0100 |
commit | 49e20c4c9efe1c0e74f9c0dc224a8014b93faa3c (patch) | |
tree | d5a63eca0b4a438f805285882a8fda0d930d25c2 /llvm/lib/Object/ELFObjectFile.cpp | |
parent | 91bc50c0d7a35a589f30fbec180cc7cea1288779 (diff) | |
download | llvm-49e20c4c9efe1c0e74f9c0dc224a8014b93faa3c.zip llvm-49e20c4c9efe1c0e74f9c0dc224a8014b93faa3c.tar.gz llvm-49e20c4c9efe1c0e74f9c0dc224a8014b93faa3c.tar.bz2 |
[RISCV] Consume error from parsing attributes section
Summary:
We don't consume the error from getBuildAttributes, so an assertions
build crashes with "Program aborted due to an unhandled Error:".
Explicitly consume it like the ARM version in that case.
Reviewers: asb, jhenderson, MaskRay, HsiangKai
Reviewed By: MaskRay
Subscribers: kristof.beyls, hiraditya, simoncook, kito-cheng, shiva0217, rogfer01, rkruppe, psnobl, benna, Jim, lenary, s.egerton, sameer.abuasal, luismarques, evandro, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77841
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/ELFObjectFile.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index 8627d1b..c919d25 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -297,8 +297,11 @@ SubtargetFeatures ELFObjectFileBase::getRISCVFeatures() const { // Add features according to the ELF attribute section. // If there are any unrecognized features, ignore them. RISCVAttributeParser Attributes; - if (Error E = getBuildAttributes(Attributes)) + if (Error E = getBuildAttributes(Attributes)) { + // TODO Propagate Error. + consumeError(std::move(E)); return Features; // Keep "c" feature if there is one in PlatformFlags. + } Optional<StringRef> Attr = Attributes.getAttributeString(RISCVAttrs::ARCH); if (Attr.hasValue()) { |