forked from OSchip/llvm-project
Do not assert fail or crash when a bytecode parse fails!
llvm-svn: 6284
This commit is contained in:
parent
e69a1b9866
commit
c56bdc5520
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -45,6 +45,9 @@ public:
|
|||
FirstDerivedTyID = Type::FirstDerivedTyID;
|
||||
}
|
||||
~BytecodeParser() {
|
||||
freeState();
|
||||
}
|
||||
void freeState() {
|
||||
freeTable(Values);
|
||||
freeTable(LateResolveValues);
|
||||
freeTable(ModuleValues);
|
||||
|
|
Loading…
Reference in New Issue