aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-24 00:21:45 +0000
committerChris Lattner <sabre@nondot.org>2007-04-24 00:21:45 +0000
commite84bcb922de726309c299ecba4ec3d14d5f67c41 (patch)
tree52747724d622109b522e6176c55b1e016a5860b0
parent6dbfd7bfbcc7a69c978452560033fa5953db2cbf (diff)
downloadexternal_llvm-e84bcb922de726309c299ecba4ec3d14d5f67c41.zip
external_llvm-e84bcb922de726309c299ecba4ec3d14d5f67c41.tar.gz
external_llvm-e84bcb922de726309c299ecba4ec3d14d5f67c41.tar.bz2
move check to the right place :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36386 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 97f33a9..e728b3f 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -322,8 +322,11 @@ bool BitcodeReader::ParseModule(BitstreamReader &Stream,
// Read all the records for this module.
while (!Stream.AtEndOfStream()) {
unsigned Code = Stream.ReadCode();
- if (Code == bitc::END_BLOCK)
+ if (Code == bitc::END_BLOCK) {
+ if (!GlobalInits.empty())
+ return Error("Malformed global initializer set");
return Stream.ReadBlockEnd();
+ }
if (Code == bitc::ENTER_SUBBLOCK) {
switch (Stream.ReadSubBlockID()) {
@@ -358,8 +361,6 @@ bool BitcodeReader::ParseModule(BitstreamReader &Stream,
case bitc::MODULE_CODE_VERSION: // VERSION: [version#]
if (Record.size() < 1)
return Error("Malformed MODULE_CODE_VERSION");
- if (!GlobalInits.empty())
- return Error("Malformed global initializer set");
// Only version #0 is supported so far.
if (Record[0] != 0)
return Error("Unknown bitstream version!");