mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-12-01 18:11:25 +00:00
[llvm-bcanalyzer] Fixed error 'Expected<T> must be checked before access or destruction'
After rL365286 I had failing test: LLVM :: tools/gold/X86/v1.12/thinlto_emit_linked_objects.ll It was failing with the output: $ llvm-bcanalyzer --dump llvm/test/tools/gold/X86/v1.12/Output/thinlto_emit_linked_objects.ll.tmp3.o.thinlto.bc Expected<T> must be checked before access or destruction. Unchecked Expected<T> contained error: Unexpected end of file reading 0 of 0 bytesStack dump: Change-Id: I07e03262074ea5e0aae7a8d787d5487c87f914a2 llvm-svn: 366387
This commit is contained in:
1 parent
7bb5fc0583
commit
3eab4819f2
1 file changed
+5
-2
@@ -539,8 +539,11 @@ BitcodeAnalyzer::BitcodeAnalyzer(StringRef Buffer,
|
||||
|
||||
Error BitcodeAnalyzer::analyze(Optional<BCDumpOptions> O,
|
||||
Optional<StringRef> CheckHash) {
|
||||
if (Expected<CurStreamTypeType> H = analyzeHeader(O, Stream))
|
||||
CurStreamType = *H;
|
||||
Expected<CurStreamTypeType> MaybeType = analyzeHeader(O, Stream);
|
||||
if (!MaybeType)
|
||||
return MaybeType.takeError();
|
||||
else
|
||||
CurStreamType = *MaybeType;
|
||||
|
||||
Stream.setBlockInfo(&BlockInfo);
|
||||
|
||||
|
||||
Reference in new issue
Block a user