From 798892661ceca2b70e1dc751d61fd6b0da0cee8e Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Sat, 21 Nov 2015 03:51:23 +0000 Subject: [PATCH] Move new assert to correct location This assert was meant to execute at the end of parseMetadata, but we return early and never reach the end of the function. Caught by a compile-time warning since the function doesn't return a value from that location. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253762 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/BitcodeReader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index f2b0a0fd678..9d907773cb3 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1967,6 +1967,9 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) { return error("Malformed block"); case BitstreamEntry::EndBlock: MDValueList.tryToResolveCycles(); + assert((!(ModuleLevel && SeenModuleValuesRecord) || + NumModuleMDs == MDValueList.size()) && + "Inconsistent bitcode: METADATA_VALUES mismatch"); return std::error_code(); case BitstreamEntry::Record: // The interesting case. @@ -2396,9 +2399,6 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) { } } } - assert((!(ModuleLevel && SeenModuleValuesRecord) || - NumModuleMDs == MDValueList.size()) && - "Inconsistent bitcode: METADATA_VALUES mismatch"); #undef GET_OR_DISTINCT } -- 2.34.1