Do not assert fail or crash when a bytecode parse fails!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6284 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-05-22 18:26:48 +00:00
parent 12e6465d89
commit a2602f3dfd
2 changed files with 4 additions and 0 deletions

View File

@ -642,6 +642,7 @@ Module *BytecodeParser::ParseBytecode(const unsigned char *Buf,
TheModule = new Module(ModuleID);
if (ParseModule(Buf, EndBuf)) {
freeState(); // Must destroy handles before deleting module!
delete TheModule;
TheModule = 0;
}

View File

@ -45,6 +45,9 @@ public:
FirstDerivedTyID = Type::FirstDerivedTyID;
}
~BytecodeParser() {
freeState();
}
void freeState() {
freeTable(Values);
freeTable(LateResolveValues);
freeTable(ModuleValues);