[llvm] r253762 - Move new assert to correct location
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 20 19:51:23 PST 2015
Author: tejohnson
Date: Fri Nov 20 21:51:23 2015
New Revision: 253762
URL: http://llvm.org/viewvc/llvm-project?rev=253762&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=253762&r1=253761&r2=253762&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Fri Nov 20 21:51:23 2015
@@ -1967,6 +1967,9 @@ std::error_code BitcodeReader::parseMeta
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::parseMeta
}
}
}
- assert((!(ModuleLevel && SeenModuleValuesRecord) ||
- NumModuleMDs == MDValueList.size()) &&
- "Inconsistent bitcode: METADATA_VALUES mismatch");
#undef GET_OR_DISTINCT
}
More information about the llvm-commits
mailing list