[llvm] r206991 - X86AsmParser.cpp: Fix memory leak at replacing movsd to movsl.

NAKAMURA Takumi geek4civic at gmail.com
Wed Apr 23 07:51:36 PDT 2014


Author: chapuni
Date: Wed Apr 23 09:51:35 2014
New Revision: 206991

URL: http://llvm.org/viewvc/llvm-project?rev=206991&view=rev
Log:
X86AsmParser.cpp: Fix memory leak at replacing movsd to movsl.

Modified:
    llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp

Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=206991&r1=206990&r2=206991&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Apr 23 09:51:35 2014
@@ -2073,8 +2073,10 @@ ParseInstruction(ParseInstructionInfo &I
       (Name == "smov" || Name == "smovb" || Name == "smovw" ||
        Name == "smovl" || Name == "smovd" || Name == "smovq"))) {
     if (Operands.size() == 1) {
-      if (Name == "movsd")
+      if (Name == "movsd") {
+        delete Operands.back();
         Operands.back() = X86Operand::CreateToken("movsl", NameLoc);
+      }
       if (isParsingIntelSyntax()) {
         Operands.push_back(DefaultMemDIOperand(NameLoc));
         Operands.push_back(DefaultMemSIOperand(NameLoc));





More information about the llvm-commits mailing list