Skip to content

Commit fd461fe

Browse files
author
Greg Clayton
committed
Unbreak buildbots where the debug info test was crashing due to unchecked error.
llvm-svn: 289017
1 parent 4903441 commit fd461fe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ Triple getHostTripleForAddrSize(uint8_t AddrSize) {
5151
/// \returns true if there were errors, false otherwise.
5252
template <typename T>
5353
static bool HandleExpectedError(T &Expected) {
54-
if (!Expected)
55-
return false;
5654
std::string ErrorMsg;
5755
handleAllErrors(Expected.takeError(), [&](const llvm::ErrorInfoBase &EI) {
5856
ErrorMsg = EI.message();
5957
});
60-
::testing::AssertionFailure() << "error: " << ErrorMsg;
61-
return true;
58+
if (!ErrorMsg.empty()) {
59+
::testing::AssertionFailure() << "error: " << ErrorMsg;
60+
return true;
61+
}
62+
return false;
6263
}
6364

6465
template <uint16_t Version, class AddrType, class RefAddrType>

0 commit comments

Comments
 (0)