[PATCH] D63518: BitStream reader: propagate errors

Francis Visoiu Mistrih via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 25 16:43:41 PDT 2019


thegameg added inline comments.


================
Comment at: llvm/include/llvm/Bitcode/BitstreamReader.h:489
 
   bool ReadBlockEnd() {
     if (BlockScope.empty()) return true;
----------------
jfb wrote:
> thegameg wrote:
> > Any reason why this doesn't return `Error`?
> I'm not sure it's really an error: it goes to the end of the block either because it's empty, or because it pops the scope (which doesn't error either). It might be erroneously used, but I'm not sure we should make it an error right now. WDYT?
Yeah, I'm not sure either... `BitstreamCursor::advance` seems to return `BitstreamEntry::getError();` if this function fails after it encountered an `END_BLOCK`, and the other users seem to return things like `SDError::InvalidDiagnostics` or `Cursor::BadBlock`.

I guess for now, it's fine as it is.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63518/new/

https://reviews.llvm.org/D63518





More information about the cfe-commits mailing list