[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Nov 15 13:55:47 PST 2004
Changes in directory llvm/lib/Bytecode/Reader:
Reader.cpp updated: 1.140 -> 1.141
---
Log message:
Make *SURE* to null out the pointer before throwing an exception, otherwise
the dtor for the BytecodeReader class will try to free it again!
---
Diffs of the changes: (+6 -2)
Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.140 llvm/lib/Bytecode/Reader/Reader.cpp:1.141
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.140 Mon Nov 15 15:43:03 2004
+++ llvm/lib/Bytecode/Reader/Reader.cpp Mon Nov 15 15:55:33 2004
@@ -2240,8 +2240,10 @@
freeState();
delete TheModule;
TheModule = 0;
- if (decompressedBlock != 0 )
+ if (decompressedBlock != 0 ) {
::free(decompressedBlock);
+ decompressedBlock = 0;
+ }
throw;
} catch (...) {
std::string msg("Unknown Exception Occurred");
@@ -2249,8 +2251,10 @@
freeState();
delete TheModule;
TheModule = 0;
- if (decompressedBlock != 0 )
+ if (decompressedBlock != 0) {
::free(decompressedBlock);
+ decompressedBlock = 0;
+ }
throw msg;
}
}
More information about the llvm-commits
mailing list