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

[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 c3f9b65b2c
commit b7d2d21a27

View File

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