summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-03-31 07:16:49 +0000
committerChris Lattner <sabre@nondot.org>2002-03-31 07:16:49 +0000
commit041468ff3fe5432ed6997737d0980cbdc8fcb4f0 (patch)
tree47551a3e9b1c00555043b943e1c421380136e2d3
parentd45f4df2ae4ed823504b49ca5dc5bbfa26551770 (diff)
downloadbcm5719-llvm-041468ff3fe5432ed6997737d0980cbdc8fcb4f0.tar.gz
bcm5719-llvm-041468ff3fe5432ed6997737d0980cbdc8fcb4f0.zip
* Fix nondeleted type handle which could cause type pool corruption (and
a memory leak) * Fix memory leak of Argument nodes on function prototypes llvm-svn: 2065
-rw-r--r--llvm/lib/AsmParser/llvmAsmParser.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y
index 5692bf48e22..3c0bb8f101d 100644
--- a/llvm/lib/AsmParser/llvmAsmParser.y
+++ b/llvm/lib/AsmParser/llvmAsmParser.y
@@ -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
}
}
OpenPOWER on IntegriCloud