[llvm-xray] consumeError when trying big-endian

Follow-up of rL341226.

Fixes "Expected<T> must be checked before access or destruction"
This commit is contained in:
Fangrui Song 2020-05-16 22:42:52 -07:00
parent 8092c8fec0
commit 3dbbbcc80e
1 changed files with 1 additions and 0 deletions

View File

@ -410,6 +410,7 @@ Expected<Trace> llvm::xray::loadTraceFile(StringRef Filename, bool Sort) {
auto TraceOrError = loadTrace(LittleEndianDE, Sort);
if (!TraceOrError) {
DataExtractor BigEndianDE(Data, false, 8);
consumeError(TraceOrError.takeError());
TraceOrError = loadTrace(BigEndianDE, Sort);
}
return TraceOrError;