Delete token *after* reading from it.

llvm-svn: 115311
This commit is contained in:
Benjamin Kramer 2010-10-01 12:25:27 +00:00
parent 47a3b8c30b
commit 14e909a942
1 changed files with 1 additions and 1 deletions

View File

@ -1126,7 +1126,6 @@ MatchAndEmitInstruction(SMLoc IDLoc,
Inst.setOpcode(X86::WAIT);
Out.EmitInstruction(Inst);
delete Operands[0];
const char *Repl =
StringSwitch<const char*>(Op->getToken())
.Case("finit", "fninit")
@ -1136,6 +1135,7 @@ MatchAndEmitInstruction(SMLoc IDLoc,
.Case("fstsw", "fnstsw")
.Default(0);
assert(Repl && "Unknown wait-prefixed instruction");
delete Operands[0];
Operands[0] = X86Operand::CreateToken(Repl, IDLoc);
}