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

llvm-svn: 6284
This commit is contained in:
Chris Lattner 2003-05-22 18:26:48 +00:00
parent bb4bd699e0
commit f354fef44b
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);