diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-22 18:26:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-22 18:26:48 +0000 |
commit | a2602f3dfd0561bf5825e301c173628c35525db8 (patch) | |
tree | 98e549f52320bbffd8def2ec5c81047c10548540 /lib/Bytecode | |
parent | 12e6465d89e24c0b20d7496bb1c0129f47dff6ce (diff) | |
download | external_llvm-a2602f3dfd0561bf5825e301c173628c35525db8.zip external_llvm-a2602f3dfd0561bf5825e301c173628c35525db8.tar.gz external_llvm-a2602f3dfd0561bf5825e301c173628c35525db8.tar.bz2 |
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
Diffstat (limited to 'lib/Bytecode')
-rw-r--r-- | lib/Bytecode/Reader/Reader.cpp | 1 | ||||
-rw-r--r-- | lib/Bytecode/Reader/ReaderInternals.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp index 7c0e6d4..1a7e3d5 100644 --- a/lib/Bytecode/Reader/Reader.cpp +++ b/lib/Bytecode/Reader/Reader.cpp @@ -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; } diff --git a/lib/Bytecode/Reader/ReaderInternals.h b/lib/Bytecode/Reader/ReaderInternals.h index 6709bc2..a8ee6fc 100644 --- a/lib/Bytecode/Reader/ReaderInternals.h +++ b/lib/Bytecode/Reader/ReaderInternals.h @@ -45,6 +45,9 @@ public: FirstDerivedTyID = Type::FirstDerivedTyID; } ~BytecodeParser() { + freeState(); + } + void freeState() { freeTable(Values); freeTable(LateResolveValues); freeTable(ModuleValues); |