Don't leak the old operand when transforming "sldt" into "sldtw".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113200 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2010-09-07 14:40:58 +00:00
parent 32c685cb67
commit aceeb3a4e2

View File

@ -837,8 +837,10 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
// effect (both store to a 16-bit mem). Force to sldtw to avoid ambiguity
// errors, since its encoding is the most compact.
if (Name == "sldt" && Operands.size() == 2 &&
static_cast<X86Operand*>(Operands[1])->isMem())
static_cast<X86Operand*>(Operands[1])->isMem()) {
delete Operands[0];
Operands[0] = X86Operand::CreateToken("sldtw", NameLoc);
}
return false;
}