diff options
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 74a5553ce6e..c874a84e0cb 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3055,7 +3055,9 @@ std::error_code BitcodeReader::rememberAndSkipFunctionBodies() { if (Stream.AtEndOfStream()) return error("Could not find function in stream"); - assert(SeenFirstFunctionBody); + if (!SeenFirstFunctionBody) + return error("Trying to materialize functions before seeing function blocks"); + // An old bitcode file with the symbol table at the end would have // finished the parse greedily. assert(SeenValueSymbolTable); |