[asan] Fix x86-32 asm instrumentation to preserve flags.

Patch by Yuri Gorshenin.

llvm-svn: 209280
This commit is contained in:
Evgeniy Stepanov 2014-05-21 08:14:24 +00:00
parent b4e24fccd1
commit fc9c78a6b6
1 changed files with 1 additions and 2 deletions

View File

@ -161,8 +161,7 @@ void X86AddressSanitizer32::InstrumentMemOperandImpl(
MCSymbolRefExpr::Create(FuncSym, MCSymbolRefExpr::VK_PLT, Ctx);
EmitInstruction(Out, MCInstBuilder(X86::CALLpcrel32).addExpr(FuncExpr));
}
EmitInstruction(Out, MCInstBuilder(X86::ADD32ri).addReg(X86::ESP)
.addReg(X86::ESP).addImm(4));
EmitInstruction(Out, MCInstBuilder(X86::POP32r).addReg(X86::EAX));
EmitInstruction(Out, MCInstBuilder(X86::POP32r).addReg(X86::EAX));
}