[PATCH] D63518: BitStream reader: propagate errors
Michael Spencer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 25 14:21:32 PDT 2019
Bigcheese added inline comments.
================
Comment at: clang-tools-extra/clang-doc/BitcodeReader.cpp:527-529
+ if (llvm::Error Err = readSubBlock(BlockOrCode, I)) {
+ if (llvm::Error Skipped = Stream.SkipBlock())
+ return Skipped;
----------------
This is a pretty big behavior change. Is clang-doc expecting to get files with unknown blocks?
================
Comment at: clang-tools-extra/clang-doc/BitcodeReader.cpp:611-618
+ Expected<unsigned> MaybeCode = Stream.ReadCode();
+ if (!MaybeCode) {
+ // FIXME this drops the error on the floor.
+ consumeError(MaybeCode.takeError());
+ }
+
+ // FIXME check that the enum is in range.
----------------
Does `consumeError` return? `MaybeCode.get()` will crash if `!MaybeCode`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63518/new/
https://reviews.llvm.org/D63518
More information about the llvm-commits
mailing list