[llvm-commits] [llvm] r138053 - /llvm/trunk/lib/MC/MCDisassembler/EDToken.cpp
Sean Callanan
scallanan at apple.com
Fri Aug 19 11:23:06 PDT 2011
Author: spyffe
Date: Fri Aug 19 13:23:06 2011
New Revision: 138053
URL: http://llvm.org/viewvc/llvm-project?rev=138053&view=rev
Log:
Fixed a memory bug in the MCDisassembler where
MCParsedAsmOperand objects were being leaked.
Modified:
llvm/trunk/lib/MC/MCDisassembler/EDToken.cpp
Modified: llvm/trunk/lib/MC/MCDisassembler/EDToken.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler/EDToken.cpp?rev=138053&r1=138052&r2=138053&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDisassembler/EDToken.cpp (original)
+++ llvm/trunk/lib/MC/MCDisassembler/EDToken.cpp Fri Aug 19 13:23:06 2011
@@ -93,8 +93,12 @@
SmallVector<AsmToken, 10> asmTokens;
if (disassembler.parseInst(parsedOperands, asmTokens, str))
+ {
+ for (unsigned i = 0, e = parsedOperands.size(); i != e; ++i)
+ delete parsedOperands[i];
return -1;
-
+ }
+
SmallVectorImpl<MCParsedAsmOperand*>::iterator operandIterator;
unsigned int operandIndex;
SmallVectorImpl<AsmToken>::iterator tokenIterator;
More information about the llvm-commits
mailing list