diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp | 7 | 
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp b/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp index 87940509741..9c30d563a31 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp @@ -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);  | 

