mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
* Fix nondeleted type handle which could cause type pool corruption (and
a memory leak) * Fix memory leak of Argument nodes on function prototypes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2065 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b28bf05483
commit
09c07538a8
@ -1094,6 +1094,7 @@ ConstPool : ConstPool OptAssign CONST ConstVal {
|
||||
(char*)GV->getName().c_str()));
|
||||
}
|
||||
}
|
||||
delete $6;
|
||||
}
|
||||
| /* empty: end of list */ {
|
||||
}
|
||||
@ -1224,8 +1225,10 @@ FunctionHeaderH : OptInternal TypesV STRINGCONSTANT '(' ArgList ')' {
|
||||
} else if ($5) {
|
||||
// If we are a declaration, we should free the memory for the argument list!
|
||||
for (list<pair<FunctionArgument*, char*> >::iterator I = $5->begin();
|
||||
I != $5->end(); ++I)
|
||||
I != $5->end(); ++I) {
|
||||
if (I->second) free(I->second); // Free the memory for the name...
|
||||
delete I->first; // Free the unused function argument
|
||||
}
|
||||
delete $5; // Free the memory for the list itself
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user