1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

Fix two (three) more issues with unchecked Error.

Summary:
If assertions are disabled, but LLVM_ABI_BREAKING_CHANGES is enabled,
this will cause an issue with an unchecked Success. Switching to
consumeError() is the correct way to bypass the check. This patch also
includes disabling 2 tests that can't work without assertions enabled,
since llvm_unreachable() with NDEBUG won't crash.

Reviewers: llvm-commits, lhames

Reviewed By: lhames

Subscribers: lhames, pirama

Differential Revision: https://reviews.llvm.org/D36729

llvm-svn: 311739
This commit is contained in:
Stephen Hines 2017-08-25 00:48:21 +00:00
parent 78f62fed59
commit 7bc4971ffd
2 changed files with 2 additions and 4 deletions

View File

@ -168,10 +168,8 @@ public:
void deregisterEHFrames() override {
for (auto &Frame : RegisteredEHFrames) {
auto Err = Client.deregisterEHFrames(Frame.Addr, Frame.Size);
// FIXME: Add error poll.
assert(!Err && "Failed to register remote EH frames.");
(void)Err;
llvm::cantFail(Client.deregisterEHFrames(Frame.Addr, Frame.Size));
}
}

View File

@ -483,7 +483,7 @@ TEST(Error, CantFailSuccess) {
}
// Test that cantFail results in a crash if you pass it a failure value.
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
#if LLVM_ENABLE_ABI_BREAKING_CHECKS && !defined(NDEBUG)
TEST(Error, CantFailDeath) {
EXPECT_DEATH(
cantFail(make_error<StringError>("foo", inconvertibleErrorCode())),