mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Fix massive resource leaks in the bytecode reader. Reading a bytecode file
with ParseBytecodeFile used to leak both a ModuleProvider (and related bytecode parser stuff attached to it) AND a file descriptor, which was never closed. This prevented gccld/llvm-ld/llvm-link from linking together apps with more that ~252 .bc files on darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30912 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -248,6 +248,12 @@ protected:
|
||||
/// @brief Parse a string constants block
|
||||
void ParseStringConstants(unsigned NumEntries, ValueTable &Tab);
|
||||
|
||||
/// @brief Release our memory.
|
||||
void freeState() {
|
||||
freeTable(FunctionValues);
|
||||
freeTable(ModuleValues);
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @name Data
|
||||
/// @{
|
||||
@ -467,12 +473,6 @@ private:
|
||||
/// given constant.
|
||||
void ResolveReferencesToConstant(Constant *C, unsigned Typ, unsigned Slot);
|
||||
|
||||
/// @brief Release our memory.
|
||||
void freeState() {
|
||||
freeTable(FunctionValues);
|
||||
freeTable(ModuleValues);
|
||||
}
|
||||
|
||||
/// @brief Free a table, making sure to free the ValueList in the table.
|
||||
void freeTable(ValueTable &Tab) {
|
||||
while (!Tab.empty()) {
|
||||
|
Reference in New Issue
Block a user