[llvm] 3dbbbcc - [llvm-xray] consumeError when trying big-endian
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat May 16 22:45:04 PDT 2020
Author: Fangrui Song
Date: 2020-05-16T22:44:48-07:00
New Revision: 3dbbbcc80e673a79f96b40a16a538dca65b709ab
URL: https://github.com/llvm/llvm-project/commit/3dbbbcc80e673a79f96b40a16a538dca65b709ab
DIFF: https://github.com/llvm/llvm-project/commit/3dbbbcc80e673a79f96b40a16a538dca65b709ab.diff
LOG: [llvm-xray] consumeError when trying big-endian
Follow-up of rL341226.
Fixes "Expected<T> must be checked before access or destruction"
Added:
Modified:
llvm/lib/XRay/Trace.cpp
Removed:
################################################################################
diff --git a/llvm/lib/XRay/Trace.cpp b/llvm/lib/XRay/Trace.cpp
index 4f107e1059cc..5ceb269b6d1d 100644
--- a/llvm/lib/XRay/Trace.cpp
+++ b/llvm/lib/XRay/Trace.cpp
@@ -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;
More information about the llvm-commits
mailing list