llvm.org GIT mirror llvm / c2588cb
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311739 91177308-0d34-0410-b5e6-96231b3b80d8 Stephen Hines 2 years ago
2 changed file(s) with 2 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
167167
168168 void deregisterEHFrames() override {
169169 for (auto &Frame : RegisteredEHFrames) {
170 auto Err = Client.deregisterEHFrames(Frame.Addr, Frame.Size);
171170 // FIXME: Add error poll.
172 assert(!Err && "Failed to register remote EH frames.");
173 (void)Err;
171 llvm::cantFail(Client.deregisterEHFrames(Frame.Addr, Frame.Size));
174172 }
175173 }
176174
482482 }
483483
484484 // Test that cantFail results in a crash if you pass it a failure value.
485 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
485 #if LLVM_ENABLE_ABI_BREAKING_CHECKS && !defined(NDEBUG)
486486 TEST(Error, CantFailDeath) {
487487 EXPECT_DEATH(
488488 cantFail(make_error("foo", inconvertibleErrorCode())),