From c1edf566b9ba18806c9a69e77db1cc8e57a14c8d Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Fri, 11 Nov 2016 04:29:25 +0000 Subject: Prevent at compile time converting from Error::success() to Expected This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index d2c2ec7..270a1c4 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -4330,7 +4330,7 @@ Expected BitcodeReader::parseTriple() { case BitstreamEntry::Error: return error("Malformed block"); case BitstreamEntry::EndBlock: - return Error::success(); + return ""; case BitstreamEntry::SubBlock: if (Entry.ID == bitc::MODULE_BLOCK_ID) @@ -4363,14 +4363,14 @@ Expected BitcodeReader::parseIdentificationBlock() { // we need to make sure we aren't at the end of the stream before calling // advance, otherwise we'll get an error. if (Stream.AtEndOfStream()) - return Error::success(); + return ""; BitstreamEntry Entry = Stream.advance(); switch (Entry.Kind) { case BitstreamEntry::Error: return error("Malformed block"); case BitstreamEntry::EndBlock: - return Error::success(); + return ""; case BitstreamEntry::SubBlock: if (Entry.ID == bitc::IDENTIFICATION_BLOCK_ID) { @@ -4421,7 +4421,7 @@ Expected BitcodeReader::hasObjCCategory() { case BitstreamEntry::Error: return error("Malformed block"); case BitstreamEntry::EndBlock: - return Error::success(); + return false; case BitstreamEntry::SubBlock: if (Entry.ID == bitc::MODULE_BLOCK_ID) -- cgit v1.1