1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +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);
if (!TraceOrError) {
DataExtractor BigEndianDE(Data, false, 8);
consumeError(TraceOrError.takeError());
TraceOrError = loadTrace(BigEndianDE, Sort);
}
return TraceOrError;